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: Error creating package

Re: Error creating package

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Thu, 14 Feb 2002 19:13:51 +0000
Message-ID: <3C6C0C6F.64D5@yahoo.com>


Andy Rigby wrote:
>
> I am trying to create a package that will let me return a cursor from
> an Oracle table (MYSCHEMA.TBL19) via ADO. I am following some sample
> code found in this newsgroup, but I keep getting an error in the
> package body when compiling it:
>
> See below for the error messages:
>
> /////////////////////////
> Oracle database (8.1.7)
> /////////////////////////
>
> SQL> create or replace package adoDemo
> 2 as
> 3 type rc_emp is ref cursor;
> 4 procedure getEmployees(p_cursor out rc_emp);
> 5 end adoDemo;
> 6 /
>
> Package created.
>
> SQL> create or replace package body adoDemo
> 2 as
> 3 procedure getEmployees(p_cursor out rc_emp) is
> 4 begin
> 5 open p_cursor for select ename from MYSCHEMA.TBL19;
> 6 end getEmployees;
> 7 end adoDemo;
> 8 /
>
> There are 2 errors which appear:
>
> 5/25 PL/SQL Statement ignored
> 5/43 PLS-00201: identifier 'MYSCHEMA.TBL19' must be declared
>
> But MYSCHEMA.TBL19 exists and I can select from it (select * from
> MYSCHEMA.TBL19) so I cannot see where the problem lies.
>
> Andy

Try this:

SQL> set role none;

and then try to compile etc...This is how the PL/SQL compilier see things ie 'sans' roles.

hth
connor

-- 
==============================
Connor McDonald

http://www.oracledba.co.uk

"Some days you're the pigeon, some days you're the statue..."
Received on Thu Feb 14 2002 - 13:13:51 CST

Original text of this message

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