This is my .sh file
sqlplus -s my_user/my_pswd@mydb @my_sql.sql
ret_code=$?
if [ $ret_code -ne 0 ]
then
echo "return code is $ret_code "
echo "Failed"
else
echo "return code is $ret_code "
echo "Success"
fi
=====================================================
and my_sql.sql is
whenever SQLERROR exit SQL.SQLCODE;
select 1/0 from dual;
quit;
=======================================================
WHen I run this, this is the output I'm getting,
select 1/0 from dual
*
ERROR at line 1:
ORA-01476: divisor is equal to zero
return code is 196
Failed.
==================================
My question is, why the error code is 196 instead of 1476 ?