Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: EXIT SQL.SQLCODE and ksh
Lisa,
Here's an example of one way to do it.
Jared
var exitval number;
create or replace FUNCTION SetErr ( ErrMode IN NUMBER )
RETURN NUMBER
IS
BEGIN return ErrMode; END;
show errors
execute :exitval := SetErr(&1);
spool /tmp/_errval.sql
select 'whenever sqlerror exit ' || :exitval from dual;
spool off
@/tmp/_errval.sql
drop table does_not_exist;
> Anyone know how to catch this value in a ksh script? I believe I've seen it
> done before but I just can't remember how. For example:
>
> ...ksh script executing
>
> sqlplus lisa/shutup << !
> whenever sqlerror exit sql.sqlcode
>
> ..statements...
> exit;
> !
>
> Do something with the error value down here in the ksh script.
>
> Thanks everyone
> GO VIKINGS!
>
> Lisa Rutland Koivu
> Oracle Database Administrator
> Qode.com
> 4850 North State Road 7
> Suite G104
> Fort Lauderdale, FL 33319
>
> V: 954.484.3191, x174
> F: 954.484.2933
> C: 954.658.5849
> http://www.qode.com
>
> "The information contained herein does not express the opinion or position
> of Qode.com and cannot be attributed to or made binding upon Qode.com."
>
>
Jared Still
Certified Oracle DBA and Part Time Perl Evangelist ;-)
Regence BlueCross BlueShield of Oregon
jkstill_at_bcbso.com - Work - preferred address
Received on Fri Sep 15 2000 - 10:34:42 CDT
![]() |
![]() |