Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: EXIT SQL.SQLCODE and ksh

Re: EXIT SQL.SQLCODE and ksh

From: Jared Still <jkstill_at_bcbso.com>
Date: Fri, 15 Sep 2000 08:34:42 -0700 (PDT)
Message-Id: <10620.117123@fatcity.com>


Lisa,

Here's an example of one way to do it.

Jared



set head off feed off pages0

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;



On Thu, 14 Sep 2000, Koivu, Lisa wrote:

> 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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US