Search code examples
shellunixplsqlautosys

Terminate shell script if stored proc fails, to capture status in my autosys job


I have Korn script that executes my SQL stored proc. My Autosys job invokes this script. I want to capture the status of the stored proc in my autosys job. Right now even if my stored proc fails, autosys captures success since the shell script succeeds(i can capture teh error in script but the script it self doesn't fail). How do i fail the script if my stored proc fails and therefore fail the autosys job.


Solution

  • Exit with a non-zero return code, e.g.

    exit 1