Re: Query System-Views within Stored Procedures
Date: 1996/09/13
Message-ID: <3238d182.312786440_at_news.concentric.net>#1/1
On Wed, 11 Sep 96 21:02:00 GMT, Thomas_Kuchenbuch_at_sz.maus.de (Thomas Kuchenbuch) wrote:
>Hi,
>
>We tried querying the View "v_$session" from a cursor inside a stored
>procedure. Same query works fine, if issued directly from SQL*DBA or
>SQL*Plus. Issued inside a stored procedure (or a package containing that
>procedure) the result constantly is "ORA-00942: Table or View does not
>exist".
>
>Any Hints?
>
>Regards, Thomas
>
>---
>Send Mails >16kB to: TKuchenb_at_aol.com
You must execute your stored procedure with a user ID which has been granted access rights to the view.
As the SYS or other DBA user:
CREATE USER XYZ IDENTIFIED BY XYZ;
GRANT SELECT ON SYS.V_$SESSION TO XYZ;
There is also a sql script in $ORACLE_HOME/rdbms/admin that will
perform the grants for you but I can't remember it's name at the
moment.
Jim Joslin Received on Fri Sep 13 1996 - 00:00:00 CEST