Thursday, April 15, 2010

Get the current sql query or sql query inside a plsql or plsql call that is being exceuted by a session:

SELECT sql_text
FROM v$session s, V$SQLTEXT T
WHERE s.sql_id = T.sql_id AND s.SID =
ORDER BY piece


This query does not show the plsql code that is being executed rather it will show the sql query inside the plsql block as plsql code is executed as a unit. It will show only the top block of the plsql code.

No comments: