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: Cursor problem

Re: Cursor problem

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 09 Feb 2000 08:56:12 -0500
Message-ID: <ves2asomkrh3e2b2u6jr0h749h18g8la3o@4ax.com>


A copy of this was sent to "Erkki Arus" <erkki_at_spin.ee> (if that email address didn't require changing) On Wed, 9 Feb 2000 15:21:04 +0200, you wrote:

> Hi
>
>I have package there is declared 2 cursors:
>PACKAGE BODY xxx AS
>...
>CURSOR curUser (cUserName CHAR) IS
> SELECT user_id FROM sys.dba_users WHERE username=cUserName;
>CURSOR curUsrRights (cGrantee CHAR) IS
> SELECT granted_role FROM sys.dba_role_privs WHERE grantee=cGrantee;
>PROCEDURE ...
>...
>END;
>When I try compile this, I get 2 error messages:
>PLS-00201: identifier 'SYS.DBA_USERS' must be declared
>PLS-00201: identifier 'SYS.DBA_ROLE_PRIVS' must be declared
>I get the same message when I try to use next query in some procedure
>SELECT user_id INTO nID FROM sys.dba_users WHERE ...
>What I do wrong?
>
>The Synonyms 'DBA_USER' and 'DBA_ROLE_PRIVS' has been created in schema
>'SYS'. I'm using Personal Oracle 7.3.3.
>
>Regards, Erkki Arus
>e-mail: erkki_at_spin.ee
>ICQ: 53259421
see:

http://osi.oracle.com/~tkyte/Misc/RolesAndProcedures.html

you have access to dba_user and dba_role_privs via roles and roles are not active during the compilation of a procedure.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Feb 09 2000 - 07:56:12 CST

Original text of this message

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