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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with first stored procedure

Re: Help with first stored procedure

From: Christopher Beck <clbeck_at_us.oracle.com>
Date: Fri, 05 Mar 1999 22:48:50 GMT
Message-ID: <36e154f8.29082798@inet16.us.oracle.com>


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.



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Mar 05 1999 - 16:48:50 CST

Original text of this message

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