Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Oracle + Unix question , Error validation for SQL statements in co process ?.
I did not know that. Thats for this info as well as the rollback info.
-----Original Message-----
From: Daniel Fink [mailto:Daniel.Fink_at_Sun.COM]
Sent: Tuesday, July 20, 2004 1:12 PM
To: oracle-l_at_freelists.org
Subject: Re: Oracle + Unix question , Error validation for SQL
statements in co process ?.
Inline
Kevin Lange wrote:
> The thing is, the ?$ will not give you anthing but a 0 when you use it
after
> the SQL statement because SQLPLUS finish correctly ... even if the SQL
that
> is ran does not. i.e. The RC of SQLPLUS will always be 0 unless
SQLPLUS
> itself fails.
I must disagree. You can return a numeric value from 0 to 255 (?) from a sql*plus session. If you return a number larger than 255, it is the modulus of value/256.
$ echo $?
0
$ sqlplus "/ as sysdba"
SQL> exit 1
$ echo $?
1
$ sqlplus "/ as sysdba"
SQL> whenever sqlerror exit 1
SQL> select * from alskjfajafls;
select * from alskjfajafls
*
ERROR at line 1:
ORA-00942: table or view does not exist
$ echo $?
1
$ sqlplus "/ as sysdba"
SQL> exit 254
$ echo $?
254
$ sqlplus "/ as sysdba"
SQL> exit 255
$ echo $?
255
$ sqlplus "/ as sysdba"
SQL> exit 256
$ echo $?
0
$ sqlplus "/ as sysdba"
SQL> exit 257
$ echo $?
1
$
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html ----------------------------------------------------------------- ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line. -- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Tue Jul 20 2004 - 13:12:11 CDT
![]() |
![]() |