Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with first stored procedure
On Fri, 05 Mar 1999 20:18:57 GMT, Dieresis <dieresis_at_my-dejanews.com> wrote:
>I am new to PL/SQL and trying to compile my first PL/SQL stored
>procedure. Following is the code. The compilation errors I get are
>
>LINE/COL ERROR
>-------- ---------------------------------------------------------
>7/2 PL/SQL: SQL Statement ignored
>7/21 PLS-00201: identifier 'RPSCHEMA.V_USERS' must be declared
>
>
>Can anyone help? What am I doing wrong?
>
>
>/* Procedure to retrieve userid given login and partner */
>
>CREATE OR REPLACE PROCEDURE userid_get
>(
> login_in IN VARCHAR2 ,
> partner_in IN VARCHAR2 ,
> userid_out OUT INTEGER
>)
>AS BEGIN
> SELECT userid
> INTO userid_out
> FROM USERS
> WHERE login = login_in
> AND partner = partner_in;
>END userid_get;
>/
The error indicates that the table USERS is not owned by the owner of the stored procedure. You either need to change the query to
select userid
into userid_out
from <table_owner>.users
where login = login_in
and partner = partner_in
and make sure that the procedure owner has select granted on the table to him
or
create a public synonym users for the table users
eg.
create public synonym users for <table_owner>.users;
and again make sure that the procedure owner has the priviledge to select from it.
This way will allow your procedure to work unchanged.
hope this helps.
chris.
>
>---Dieresis [dieresis_at_my-dejanews.com]
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
--
Christopher Beck
Oracle Corporation
clbeck_at_us.oracle.com
Reston, VA.
![]() |
![]() |