When your code hits an error, your code invokes the whenever clause return the error value to the calling shell. You set the error number to what you need in the clause.
You did not mention what shell you are using but with most shells the the variable $? is the value of the return code from the previous process, you can also call wait to get a return code.
A bash example of wait would be:
Note carefully. Remove the cat command because it will interfere with the return code you want. --
All of this is based on some assumptions, if you need more help please give us the specific shell and version of AIX and Oracle.
This User Gave Thanks to jim mcnamara For This Post:
Hi,
I am trying to pass some of the variables in my shell scripts to the sqlplus call and use them as parameters.
For example, I would like to replace the 'SAS', and '20050612' with $var1 and $var2, respectively, how can I do that?
--------------------------------------------------------... (1 Reply)
Hi,
I am writing a ksh script which will use sqlplus to run a sql and pass 2 variables as the SQL request. In the ksh script, I have 2 variables which are $min_snap and $max_snap holding 2 different numbers.
Inside the same script, I am using SQLPLUS to run an Oracle SQL script,... (6 Replies)
hi fellows,
can any body tell me how to pass unix variables to oracle
code is...
#! /bin/ksh
echo ENTER DATE VALUE's
read START_DATE END_DATE
sqlplus xyx/abc@oracle
select * from table1 where coloumn1 between $START_DATE and $END_DATE;
is this is correct way...........
Thanks in... (1 Reply)
Hi,
Currently i have a .sql file 1.sql.
I need to pass that as a parameter through a shell script to the sqlplus inside the same shell script.
How I should I do.can anyone help me pls.
I have an req where I need to send the .sql file and the place where the script has to create a .csv... (9 Replies)
if
then
# mail -s "Import failed file does not exist" sanjay.jaiswal@xyz.com
echo "FILE does not exist"
exit 1
fi
echo "FILE EXIST"
size=-1
set $(du /export/home/oracle/nas/scott21.dmp.gz)
while
do
echo "Inside the loop"
size=$1
set $(du... (1 Reply)
I have a script that "runs" a script. For example:
./runscript.ksh pcnmc01.ksh
runscript puts pcnmc01.ksh into the background with log output going to the logfile.
After executing the command, I get this output:
Running script in the background: pcnmc01.ksh
Logfile:... (2 Replies)
Gurus,
The issue I'm having is that my Shell won't accept SQL parameters properly......
Here's they way I'm running it....
applmgr@ga006hds
=> sh CW_MigrationDeployScript.sh apps <appspwd> <SID> '01-JAN' '31-MAR'
The process just hangs not submitting the SQL job...
... (3 Replies)
i have file in which i have employee id are there and every time number of employee id are different in file means number of count of employee id in file are every time different.
343535435
365765767
343534543
343543543
i want to pass this file to sqlplus
and sql command is
... (7 Replies)
Hi Team,
I am trying to run a sqlplus script against several databases via a FOR/LOOP and also passing the loop variable to a sqlplus script I am calling, as follows:
#!/bin/bash
export ORACLE_SID=plgc1
export ORACLE_HOME=/opt/oracle/product/11.2.0.2/db_1
export... (1 Reply)