Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get update statement that fires an after update trigger

529226Aug 9 2007 — edited Aug 9 2007
Hi
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...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 6 2007
Added on Aug 9 2007
8 comments
1,036 views