Scripting question
I am running insert statement against the database using the following script:
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?
sqlplus 'username/pwd@MYDB' << EOF > $FILE1
whenever sqlerror exit 1 rollback
$sql
commit;
exit;
EOF
res=$?
if [ "$res" != "0" ]
then
echo error
fiFor 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?
0