Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Retrieve SQL Statement in trigger on servererror
You can use this event attribute -
ora_sql_txt (sql_text out
ora_name_list_t)
See the Oracle Doc for more info
Its in ORACLE APPLICATION DEVELOPERS GUIDE - FUNDAMENTALS (9.0.1) Chapter 16 - Working with System Events
The doc says that the servererror event is not fired if the error is caused by the following errors.
ORA-01403: data not found
ORA-01422: exact fetch returns more than requested number of rows
ORA-01423: error encountered while checking for extra rows in exact fetch
ORA-01034: ORACLE not available
ORA-04030: out of process memory
Well if you are interested in only the Last SQL statement, you can use this
col sid form 999
col curr form a40 head " Current SQL" col prev form a40 head " Previous SQL"bre on sid skip 2