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 -> The last executed sql statement

The last executed sql statement

From: <alex_nikiforenko_at_my-deja.com>
Date: Wed, 24 Nov 1999 15:26:44 GMT
Message-ID: <81h03e$tec$1@nnrp1.deja.com>


To obtain the last executed SQL statement on Oracle 7.3 server I used the following SQL statement:

    SELECT t2.sql_text,

           t2.piece
      FROM v$session t1,
           v$sqltext t2
      WHERE t1.audsid     = Userenv('SESSIONID')
        AND t2.address    = t1.prev_sql_addr
        AND t2.hash_value = t1.prev_hash_value
      ORDER BY 2;

But it does not work on Oracle 8.0.5 because of v$session.prev_sql_addr has the same value that v$session.sql_address. Has someone an idea how to get the last executed SQL statement on Oracle 8.0.5?

Any advice greatly appreciated.

Best regards,
Alex Nikiforenko.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Nov 24 1999 - 09:26:44 CST

Original text of this message

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