09-06-2001
If it's a problem with the ' in a shell script, have you tried escaping them with a \ in front of them? Also, could the numbers of embedded ('s in the script be a problem also? I haven't tried this, but how about:
sql_job () {
sqlplus -s user/user@db1 << END
set head off
set feed off
select to_char(min(create_dt) , 'HH24') from table_name where
trunc(create_dt)=trunc(sysdate-2);
/
END
}
INICIO=`sql_job | awk '{print $1}'`
echo $INICIO
This is just a guess... like I said, I didn't try this script, but this is how I would have tried it...
HTH
--
LF
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can someone tell me how to execute sqlplus command.
I`m Executing:
sqlplus user/pasw @/report/output/new/PlatformOut_Cdrs.sql
the error is:
SQL*Plus: Release 9.2.0.5.0 - Production on Wed Aug 9 15:37:44 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ERROR:... (3 Replies)
Discussion started by: Nel
3 Replies
2. Shell Programming and Scripting
How to execute a query which is stored in a variable.
Say for example :
v_source_query=”select count(*) from emp”
v_source_value=`sqlplus -S "$DATABASE_LOGIN" << EOF | tr '\n' ' '
set feed off
set pagesize 0
set head... (12 Replies)
Discussion started by: trupti_d
12 Replies
3. UNIX for Dummies Questions & Answers
hi all,
i was given by my supervisor a task to search for scripts which contain oracle sqlplus i.e "myusername/mypasswd @myDB" in every /home/userfolder, which are, all the scripts made by different user. I've done some find command to search string for sqlplus, but it may up too long to respond.... (8 Replies)
Discussion started by: Helmi
8 Replies
4. HP-UX
hi,
i need bash shell script run on the crontab(Unix tru64).
i have write my shell. it's using sqlplus command and connect to oracle db.
execute cron job when i have error messege: "sqlplus: command not found"
have you any suggestion? (4 Replies)
Discussion started by: Tlg13team
4 Replies
5. Shell Programming and Scripting
Hi folks
I use a Solaris 10 box with Bash shell.
I have here a script (it works!) to list all scripts in crontab which contains the string "sqlplus":
for i in $(ls `crontab -l | grep -v '#' | awk '{ print $6 }' | grep -v '^$'`); do grep -l 'sqlplus' "$i"; done
Is there a more elegant... (1 Reply)
Discussion started by: slashdotweenie
1 Replies
6. Ubuntu
I installed Oracle 10.2.1.0 in Ubuntu 10.10..my installation was well,i could even open isqlplus( http://ubuntu.ubuntu-domain:5560/isqlplus/workspace.uix ) and execute some queries..But,back in terminal when i try to login to sqlplus i am getting error (20 Replies)
Discussion started by: sandy0594
20 Replies
7. UNIX and Linux Applications
using sqlplus I want to execute a .sql script that has dbms_output statments in rhe script. I want to write the dbms_output statements from .sql file to a log file. is this possible. thanks
any help would be appreciated
:wall: (1 Reply)
Discussion started by: TRS80
1 Replies
8. Red Hat
Hi,
I am facing a strange issue when connecting to SQLPLUS via a shell scripts.
I am using Linux 2.6.18-274.18.1 and gbash shell.
When I connect to SQLPLUS through scripts then it throws TNS Time Out error ""sometimes"" and connects successfully other times.This is only happening when... (9 Replies)
Discussion started by: aashish.sharma8
9 Replies
9. Shell Programming and Scripting
Hi ,
i am new to unix i need a small clarification regarding this
sqlplus -s $USER_NAME/$PASSWD@$ORA_SID<< EOF >> SQL_CONN_LOG.log
In the above command what is the meaning of <<EOF>>
Thanks,
krishna. (2 Replies)
Discussion started by: rams_krishna
2 Replies
10. UNIX and Linux Applications
Hi all,
i face an error related to my server ""it's running server"" when i use sqlplus command
$ sqlplus
bash: sqlplus: command not found
the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup.
i already check the directory... (4 Replies)
Discussion started by: clerck
4 Replies
LEARN ABOUT CENTOS
error::pass1
ERROR::PASS1(7stap) ERROR::PASS1(7stap)
NAME
error::pass1 - systemtap pass-1 errors
DESCRIPTION
Errors that occur during pass 1 (parsing) usually mean a basic syntax error of some sort occurred in the systemtap script. There are sev-
eral classes of problems possible:
plain syntax error
The systemtap script parser detects a large variety of errors, such as missing operands, bad punctuation. It tries to list what
kinds of tokens it was expecting to see, and will show the region of the source code with the problem. Please review the stap(1)
man page and/or the tutorial, to correct the script's syntax.
grammar ambiguities
There is at least one known ambiguity in the systemtap grammar. It relates to the optionality of ; (semicolon) separators between
statements, and the ++ and -- increment/decrement operators. If the parser indicates an error, consider adding some explicit ; sep-
arators between nearby statements and try again.
missing command line arguments
A systemtap script that uses the $N and @N constructs for substituting in command-line options may fail if not enough options were
given on the stap command line.
compatibility changes
Some versions of systemtap have changed the language incompatibly, for example by adding the try/catch keywords for exception han-
dling. In such cases, rerun systemtap with the --compatibility=VERSION option, substituting the last systemtap version where your
script was known to work. You may also check the release-history NEWS file for compatibility changes.
GATHERING MORE INFORMATION
Increasing the verbosity of pass-1 with an option such as --vp 1 can help pinpoint the problem.
SEE ALSO
stap(1),
error::reporting(7stap)
ERROR::PASS1(7stap)