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

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL Find out last SQL run

Re: PL/SQL Find out last SQL run

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Thu, 17 Mar 2005 10:43:12 -0800
Message-ID: <1111084789.128606@yasure>


pwu_at_qantas.com.au wrote:

> Hi,
> I want to print out the last sql I ran in a general purpose exception
> handling routine for debugging purposes.
>
> I know that I can print out the call stack from PL/SQL and this would
> give me a good idea what sql that was run that caused the exception.
>
> I know that there is a showsql PL/SQL program that shows the sql run by
> active users of the instance. However the act of reading the sql is an
> sql itself and so this program would show the inquiring sql rather than
> the sql causing the exception.
>
> Anyone have any ideas how to get the last sql I ran?
>
> Thanks for any assistance

Any your version is?

One possibility: V_$SQLTEXT_WITH_NEWLINES

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Thu Mar 17 2005 - 12:43:12 CST

Original text of this message

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