Why package can't see v$session? [message #258260] |
Fri, 10 August 2007 13:31  |
ashtonkm
Messages: 10 Registered: August 2007
|
Junior Member |
|
|
I am trying to create a small package that can access the v$session view.
SQL> CREATE OR REPLACE PACKAGE k
2 AS
3 PROCEDURE audit_tes ;
4 END k;
5 /
Package created.
SQL>
SQL> CREATE OR REPLACE PACKAGE BODY k
2 IS
3 PROCEDURE audit_tes AS
4 CURSOR c1 IS
5 SELECT count(*) from v$session;
6 BEGIN
7 null;
8 END audit_tes;
9 END k;
10 /
Warning: Package Body created with compilation errors.
SQL> show errors
Errors for PACKAGE BODY K:
LINE/COL ERROR
-------- -----------------------------------------------------------------
5/2 PL/SQL: SQL Statement ignored
5/23 PL/SQL: ORA-00942: table or view does not exist
Does anyone know why I would be getting this error? I can execute the code just fine if I take it out of the package. Why is the view visible to my schema yet my package cannot see it?
Thanks
|
|
|
|
|
|
|
|
|
|