SQL code into a variable.

Hi,

Iam new to unix. Is there any way to get the sql code "ORA-01847" into a variable.

sqlplus username/password@database name << EOF
set heading off
update TempTable set variable where condition;
exit sql.sqlcode;
commit;
exit;
EOF

Output

ERROR at line 1:
ORA-01847: day of month must be between 1 and last day of month.

Is there anyway to get the above "ORA-01847" to a variable. Thanks in advance.

Hi,
Can you check on the below link :-

How do I interact with Oracle via the UNIX Korn shell? - Oracle: Oracle release - 8 and 8i FAQ - Tek-Tips

Thanks.