Get update statement that fires an after update trigger
529226Aug 9 2007 — edited Aug 9 2007Hi
I want to get the sql statement that fires an after update trigger.
I have tried with:
SELECT a.SQL_TEXT
FROM V$SESSION S, V$SQLAREA A
WHERE a.HASH_VALUE=s.SQL_HASH_VALUE
but this the result is "SELECT a.SQL_TEXT FROM V$SESSION S, V$SQLAREA A WHERE a.ADDRESS= s.SQL_ADDRESS and a.HASH_VALUE=s.SQL_HASH_VALUE"
So, I tried with:
SELECT a.SQL_TEXT
FROM V$SESSION S, V$SQLAREA A
WHERE a.HASH_VALUE=s.PREV_HASH_VALUE
But it returns other queries but not the last. I also have
tried with
select a.SQL_TEXT
from v$sqlarea a
order by a.LAST_ACTIVE_TIME desc
And with this:
SELECT SYS_CONTEXT('userenv', 'CURRENT_SQL') FROM dual
but it returns blank
Thanks for your help...