Return Code to UNIX from Procedure Package
I've found examples where a 1-byte RC can be picked up by a UNIX shell script (in $?) but they involve a PL/SQL block and bind variable in the script itself. It appears I cannot use a bind variable in a Package because the compile fails (PLS-00049: bad bind variable). UNIX does find a RC value when I use RAISE_APPLICATION_ERROR( (-20000-744) - v_rc_255, 'Abnormal Termination.' ); where v_rc_255 is a PLS_INTEGER with value 255, but the value is not 255! Sometimes it is zero, other times 7.
Is there a practical way I can signal "Abnormal Termination" from any PL/SQL Package's Procedures/Functions to UNIX so I can send my shell script down the appropriate path?