Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: v$databse
Guido vd Zweerde wrote:
>
> Hi,
>
> consider the next problem:
>
> connected as system
> select name from v$database;
> --> returns SID-name
>
> when in the next procedure :
> create or replace procedure t
> is
> x char(8);
> begin
> select name
> into x
> from v$database;
> end;
> /
>
> I get the next error:
> LINE/COL ERROR
> -----------------------------------------------------------------
> 5/3 PL/SQL: SQL Statement ignored
> 7/8 PLS-00201: identifier 'SYS.V_$DATABASE' must be declared
>
> What is the problem? If I create the procedure as 'SYS' it works, but
> that is not what I want.
>
> Thanx,
> Guido vd Zweerde
> University of Twente
> The Netherlands
> G.R.vandeZweerde_at_civ.utwente.nl
In order to create a procedure that references v$database the select (or other privs) must be granted directly to the user (not to public).
If you grant select on v_$database to user. it should be ok.
Bob Morrison Received on Wed Mar 26 1997 - 00:00:00 CST
![]() |
![]() |