Database Administration (MOSC)

MOSC Banner

Scripting question

edited Jul 15, 2013 8:53AM in Database Administration (MOSC) 3 commentsAnswered
I am running insert statement against the database using the following script:
 
sqlplus 'username/pwd@MYDB' << EOF > $FILE1
                        whenever sqlerror exit 1 rollback
                        $sql
                        commit;
                        exit;
EOF
res=$?
if [ "$res" != "0" ]
then
echo error 
fi

For some reason $res returns 1 instead of 0 even though the data gets inserted into the database and no error is written to the error log

Why the code returns 1, am I doing something wrong?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center