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: SQL*Plus errors... how to hide?

Re: SQL*Plus errors... how to hide?

From: Krishna Kakatur <Krishna.Kakatur_at_Sun.COM>
Date: Thu, 06 Nov 2003 14:24:26 -0800
Message-ID: <F001.005D5DCE.20031106142426@fatcity.com>

See the Code below. It worked fine for me.

Probably you have a raise_exception_error somewhere in the procedure.

SQL> create procedure RELEASE_PO_B_H ( in_number varchar2 ) is   2 v_number number;
  3 begin
  4 v_number := in_number;
  5 exception
  6 when value_error then
  7 dbms_output.put_line('You have entered an invalid number! Exiting program...');   8 end;
  9 /

Procedure created.

$ cat RELEASE_PO_B_H.csh
#!/bin/csh

sqlplus -s <DB String> <<EOSQL
set feedback off
set serveroutput on
exec RELEASE_PO_B_H ('yrugis');
EOSQL $ RELEASE_PO_B_H.csh
You have entered an invalid number! Exiting program...

-- 
Thanks,
Krishna

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE:  This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information.  Any unauthorized review, use, disclosure or
distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy
all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Saira Somani-Mendelin wrote:

>
> List,
>
> I have a shell script that executes a sql*plus script (which executes a
> procedure) based on user input.
>
> But what if the user inputs an invalid datatype? The exception section
> handles the error and displays a user-friendly message but I still get
> an error stack. I want to hide this from the user. How can I do this? I
> have set feedback and echo options off. See output below:
>
> PO Reconciliation Batch Release
> ================================
>
> Enter batch number to be released:
> yrugis
> You have entered an invalid number! Exiting program...
> **[I want to suppress the errors below]**
> BEGIN RELEASE_PO_B_H('yrugis'); END;
>
> *
> ERROR at line 1:
> ORA-01722: invalid number
> ORA-06512: at "TRAIN65D.RELEASE_PO_B_H", line 16
> ORA-06512: at line 1
>
> Thanks,
> Saira
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Saira Somani-Mendelin
> INET: saira_somani_at_yahoo.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Krishna Kakatur INET: Krishna.Kakatur_at_Sun.COM Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Received on Thu Nov 06 2003 - 16:24:26 CST

Original text of this message

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