sqlplus exit code
Usage: { EXIT | QUIT } [ SUCCESS | FAILURE | WARNING | n |
<variable> | :<bindvariable> ] [ COMMIT | ROLLBACK ] Example:
SQL> variable exitcode number;
SQL>
SQL> begin
2 select 23 into :exitcode from dual;
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> exit :exitcode
/home/oracle> echo $?
23
Just remember though that the exit code in Unix is not an int. exit()
in stdlib.h is, but for some reason shells rerturns a max value of 255
(I think that's the low 8 bits only). Is this a kerbel issue btw -
only have exit codes as a byte instead of a 2 byte int?
Would have been pretty nice to have the full ORA error code as the
exit code (instead of having to grep and awk stdout).
--
Billy
|