查询EBS中LOV的SQL语句

1、帮助->关于:查找会话 SID : 507;

2、点一下LOV右边的三点,触发LOV事件;

3、运行如下代码段:

DECLARE
  l_sid NUMBER := :SID;
BEGIN
  FOR cur_sql IN (SELECT sql_text
                    FROM v$sqltext_with_newlines t
                   WHERE t.address IN (SELECT s.prev_sql_addr
                                         FROM v$session s
                                        WHERE s.sid = l_sid
                                       UNION
                                       SELECT s.sql_address --如果查询时间很短,可能存在sql_address中
                                         FROM v$session s
                                        WHERE s.sid = l_sid)
                   ORDER BY t.piece) LOOP
    dbms_output.put_line(cur_sql.sql_text);
  END LOOP;
END;
posted @ 2014-07-09 20:42  新新向荣  阅读(886)  评论(0编辑  收藏  举报