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

Home -> Community -> Usenet -> c.d.o.misc -> v$session sql_address prev_sql_addr, cannot log previous sql-statement

v$session sql_address prev_sql_addr, cannot log previous sql-statement

From: bernhard labus <bernhard.labus_at_home.ins.de>
Date: Fri, 8 Feb 2002 12:02:39 +0100
Message-ID: <3c63b045$0$223$4d4ebb8e@businessnews.de.uu.net>


Hallo,

I have a problem, given situation:

Trigger on table A works fine, except:
I want to log the sql-statement, which updates table A, so I select:
select q.sql_text
from v_$session s ,v_$sql q
where s.audsid = userenv('SESSIONID')

and     q.address     = s.prev_sql_addr
and     q.hash_value = s.prev_hash_value;

Contents in table B.logged_sql_text is the statement of the trigger : "insert into table B (logtable) .. bla", not the update of table A:
"update A set ...".

As You can see above, I use *PREV*-addresses. Modification of the trigger in triggerimg-time with "after-" and "before-"update yields the same result.
when I check prec_sql_addr (and hash) before and after several statements (interactive in SQL*PLUS) I see only a constant prev_sql_addr.

Where is the trick?

Thanks
Bernhard Received on Fri Feb 08 2002 - 05:02:39 CST

Original text of this message

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