Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: sqlplus return codes on unix
In article <32cbc5ed.3223877_at_n5.gbso.net>, chuckh_at_dvol.com (Chuck Hamilton) wrote:
> Is there a way to get the full return code from SQLPLUS back to a unix
> shell script? Unix only looks at the low-order byte. Is there perhaps
> a specific shell that'll get a two byte return code?
Instead of worrying about the return code, I've created a wrapper for SQL*Plus in our unix environment. The wrapper script causes a log file to be written, then greps (we use egrep) out "ORA-" and "error", and then sets its own error code appropriately.
We use this approach with both sqlplus and sqlldr. In addition, we place comments in our script of the form "--IGNORE ORA-xxxxx", which allows egrep to ignore non-critical errors (index exists, etc.).
Let me know via email if you'd like to see the script. I hope to put it up on the Web in the not-too-distant future.
David Scott ...how can I keep from singing? bumper snicker: My other guitar is a Martin (D16H)email: dlscott_at_mindspring.com
![]() |
![]() |