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

Home -> Community -> Mailing Lists -> Oracle-L -> AW: pl/sql

AW: pl/sql

From: <v.schoen_at_inplan.de>
Date: Mon, 29 Apr 2002 07:43:24 -0800
Message-ID: <F001.00451E49.20020429074324@fatcity.com>


Hi Roland,

You can implent something like this:

   sERROR_TEXT := 'execute P1 failed';
   exec P1;
---

   IF SQLCODE != 0 THEN

      sERROR_CODE := -20005;
      sERROR_TEXT := 'execute P1 failed. Oracle Error Number:: ORA' ||
SQLCODE || '-' || SQLERRM;
      raise DATA_ERROR;

   END IF;
---

HTH Volker Schoen
E-Mail: mailto:v.schoen_at_inplan.de
http://www.inplan.de

-----Ursprüngliche Nachricht-----

Von: Roland.Skoldblom_at_ica.se [mailto:Roland.Skoldblom_at_ica.se] Gesendet: Montag, 29. April 2002 16:54
An: Multiple recipients of list ORACLE-L Betreff: pl/sql

Hallo,

I have a package which includes 5 different procedures. I would like an exception which tells me an error message if any of the procedures fail.

So if procedure 1 fails I would get an error message or if procedure number 2 would fail, or proc number 3 e tc then I would get an error message, which tells me which procedure that fails. I tried this, but didnt work. Just give me an easy example
on this. I tried to look it up in the manual but didnt get it work.

Should I put the exception after each procedureis finished.

Like this: And should I name the exceptions in different ways, for instance givethem the names EXCEPTIONS1, EXCEPTIONS2 etc.

p1
exception
p2
exeption
p3
exception
p4
exception
p5
exception

Thanks in advance

Roland

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: Roland.Skoldblom_at_ica.se

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
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.com -- Author: INET: v.schoen_at_inplan.de Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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 Mon Apr 29 2002 - 10:43:24 CDT

Original text of this message

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