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

Home -> Community -> Usenet -> c.d.o.server -> Re: Exiting PL/SQL

Re: Exiting PL/SQL

From: srivenu <srivenu_at_hotmail.com>
Date: 8 Jun 2004 22:58:34 -0700
Message-ID: <1a68177.0406082158.3c7e097d@posting.google.com>


You can exit SQL*PLUS with "exit [value]" command and the exit command will return the [value] to the OS.
$ sqlplus "/ as sysdba"

SQL> exit 10
$ echo $?

10

You can also use this for exiting from PL/SQL Put this in a file x.sql

whenever sqlerror exit 100
exec dbms_lock.sleep(30);

$ sqlplus "/ as sysdba"

SQL> @x.sql
^CBEGIN dbms_lock.sleep(30); END;

*
ERROR at line 1:
ORA-01013: user requested cancel of current operation

$ echo $?

100

regards
Srivenu Received on Wed Jun 09 2004 - 00:58:34 CDT

Original text of this message

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