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!

v$sql: table or view does not exists into PL/SQL

Samuel RabiniSep 4 2009 — edited Sep 4 2009
Hi,
I'm trying to create e job that will execute some pl/sql to check something concerning sessions and session's sql text.
I wrote the query:

SELECT s.username, s.osuser, s.machine, s.program, t.sql_text current_statement, t_prev.sql_text previous_statement
FROM v$sql t, v$session s, v$sql t_prev
WHERE t.sql_id = s.sql_id
AND s.status = 'ACTIVE'
AND s.schemaname = MYSHEMANAME
AND s.seconds_in_wait > 60
AND t_prev.sql_id = s.prev_sql_id;

This query works fine, but as soon as I include it in a PL/SQL, I get the compiling error: Error(248,21): PL/SQL: ORA-00942: table or view does not exist.

Someone has some suggestions?

Thanks in advance.

Samuel
This post has been answered by 706055 on Sep 4 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 2 2009
Added on Sep 4 2009
5 comments
5,613 views