Returning Values from Oracle to Unix Script [message #98018] |
Tue, 11 November 2003 07:30 |
Mike Muldoon
Messages: 24 Registered: March 2003 Location: Edinburgh
|
Junior Member |
|
|
Hi
Hope someone can help me here. I have a Unix script that calls a SQL file which runs an Oracle Stored Function, the command is below..
sqlplus $DATABASE @$tempSQL.sql $TO_REF_FILE $FILEDTM $PPPNNI $PPPPID
The tempSQL.sql files looks like the following:
set serveroutput on
DECLARE
errValue NUMBER;
BEGIN
errValue := IPGPPP.insertAuditTrailRec(1,0,'&&1','&&2','&&3','&&4',6,1639054);
END;
/
exit;
errVal is returned by the Oracle Function, 0 if it ran ok, a non zero error code if thee was a problem.
I wish to evaluate the value of errVal in the Unix script, if it is 0 then I am happy, otherwise the Oracle Function has failed and I don't want to proceed.
I am having trouble seeing how I can get the value held in the errVal variable back to the Unix script.
Thanks in advance if anyone can help out.
Cheers
Mike
|
|
|
|
|