Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> AW: pl/sql
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;
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 ListsReceived on Mon Apr 29 2002 - 10:43:24 CDT
--------------------------------------------------------------------
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).
![]() |
![]() |