Home » SQL & PL/SQL » SQL & PL/SQL » Trapping PL/Sql Error Messages
Trapping PL/Sql Error Messages [message #1779] Wed, 29 May 2002 04:02 Go to next message
T. Sri Sai Krishna
Messages: 17
Registered: May 2002
Junior Member
Hi,
I would like to know as to how I can trap an unhandled
error message while running or executing a PL/SQL block.
To be more specific, I want to display the error code
and the error message regardless of the possible exception handlers.
what must I use and How?
Any help will be greatly appriciated
Re: Trapping PL/Sql Error Messages [message #1787 is a reply to message #1779] Wed, 29 May 2002 15:11 Go to previous messageGo to next message
Andrew
Messages: 144
Registered: March 1999
Senior Member
in PL/SQL errors propogate up the various layers until it's handled, so by definition - if you have something like this:

when others then
null;

then that's where the error handling stops. You can't see the error once you've handled it.
Re: Trapping PL/Sql Error Messages [message #1936 is a reply to message #1779] Wed, 12 June 2002 02:23 Go to previous message
Thiyagarajan
Messages: 9
Registered: October 2000
Junior Member
This can be done by this method.

In the when others exception part, instead of null give the following code,

dbms_output.put_line(sqlerrm);
Previous Topic: Faster query with less data?
Next Topic: Inserting subscript characters into an Oracle 8.1.7 database?
Goto Forum:
  


Current Time: Fri Apr 19 20:13:20 CDT 2024