Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Problems With Using V$SESSION Procedure

Re: Problems With Using V$SESSION Procedure

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 12 Aug 2002 18:16:34 GMT
Message-ID: <3D57FB81.F9FC7778@exesolutions.com>


Salaam Yitbarek wrote:

> Hi,
>
> The following anonymous compiles:
>
> declare
> a v$session.SID%type;
> begin
> select min(SID) into a from v$session;
> dbms_output.put_line(a);
> end;
>
> However, take the above and put it in a stored procedure, and it does
> not compile, giving the error "PLS-00201: identifier 'V$SESSION' must
> be declared":
>
> create or replace procedure foo is
> a v$session.SID%type;
> begin
> select min(SID) into a from v$session;
> dbms_output.put_line(a);
> end;
>
> Now this problem occurs only with the V$ views, but not with other
> system tables or views such as ALL_ARGUMENTS, ALL_TABLES, etc.
>
> The above code was compiled under an account that has been assigned
> the DBA.
>
> Help?!
>
> Thanks,
> Salaam

This issue has been dealt with at least 100 times this year. I should probably send you to the Google.com archives to look it up yourself but since that wouldn't be nearly as satisfying as retyping the same answer again.

You need to be granted the privilege directly ... not through a role.

Daniel Morgan Received on Mon Aug 12 2002 - 13:16:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US