Re: Interactive Scripts, return codes
Date: 1997/06/06
Message-ID: <01bc720c$6db6c5c0$ad567ec2_at_cavett.globalnet.co.uk>#1/1
[Quoted] As far as returning error codes from ORACLE go - include at the beginning of your SQL script files a line such as
ON SQLERROR THEN EXIT ROLLBACK; [Quoted] This will immediatelly abort the script and rollback work before exiting if there are any SQL errors raised (un-handled exceptions).
There is a variant to this that will pass back any SQL error codes to the parent shell script and can then be handled by the script with appropriate logic steps - check 'SQL*Plus guide' for details.
I'm sure their are better qualified people out there that can advise on the UNIX scripting side. . .
Best of luck (nb. see note at end)
- Martyn Cavett Senior ORACLE Analyst LGT Asset Management London, UK. home: cavett_at_globalnet.co.uk work: Martyn.Cavett_at_gtplc.com
These views are my own and not those of my employer. Normal conditions apply.
Programming <sysdev_at_mb.sympatico.ca> wrote in article
<339703AA.9D0_at_mb.sympatico.ca>...
> Interactive scripts in Unix.
> Return codes from Oracle, or Unix.
>
<snip>
>
> The other thing that I want to do,
> is to check the return codes from
> Oracle, and abort if the commands
> failed. How can this be accomplished?
> How could I branch to another part of
> the script?
> Would the return code be from Unix,
> or from Oracle?
>
The return code is raised by ORACLE and handled in a shell script.
Received on Fri Jun 06 1997 - 00:00:00 CEST