Re: PL/SQL Exceptions value

From: Scott Urman <surman_at_oracle.com>
Date: 1995/10/20
Message-ID: <468ieg$i5k_at_inet-nntp-gw-1.us.oracle.com>#1/1


In article <1995Oct19.235418.19328_at_indyvax.iupui.edu>, msahoo_at_indyvax.iupui.edu writes:
|> PL/SQL Question:
|>
|> Hello all,
|>
|> This may be too easy (sorry!).
|>
|> Is there a system variable in PL/SQL that holds the current exception
|> value?
|>
|> Basically, I am processing some data and updating tables. If an error
|> or exception occurs for which I do not have a trap, then with the
|> aid of "WHEN OTHERS...", I want to store the error in an error log
|> table.
|>
|> Can this be done in PL/SQL?

Yep. The SQLCODE function will return the current error code, and SQLERRM will return the current error message (max of 512 characters). If you call them when not in an exception handler, SQLCODE will return 0 and SQLERRM will return 'ORA-00000: Normal Successful Completion'.

|>
|> thanks in advance,
|> Manash
Received on Fri Oct 20 1995 - 00:00:00 CET

Original text of this message