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: Newbie package/procedure syntax help

Re: Newbie package/procedure syntax help

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 25 Jan 2001 20:19:44 +0100
Message-ID: <94pu4p$etjmu$1@ID-62141.news.dfncis.de>

<james_one_at_my-deja.com> wrote in message news:94pt2d$tng$1_at_nnrp1.deja.com...
> Thanks that compiled!
> I'm getting a new error when I try to execute the procedure though. Do
> I need to include some sort of argument for the cursor when executing?
> Here is what I executed and the error:
>
>
> SQL> execute pack1.get_users('user2');
> BEGIN pack1.get_users('user2'); END;
>
> *
> ERROR at line 1:
> ORA-06550: line 1, column 7:
> PLS-00306: wrong number or types of arguments in call to 'GET_USERS'
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignored
>
>
> In article <94ps27$slb$1_at_nnrp1.deja.com>,
> Mike Krolewski <mkrolewski_at_rii.com> wrote:
> > In article <94pp13$pit$1_at_nnrp1.deja.com>,
> > james_one_at_my-deja.com wrote:
> > > Can anyone please tell me why this doesn't work? The package creates
> > > fine, but the body has 'complilation errors'. Client is 8.1.6. DB is
> > > oracle 7.3.
> > > Thanks.
> > >
> > > CREATE OR REPLACE
> > > PACKAGE PACK1 IS
> > > TYPE CURSOR_TYPE AS REF CURSOR;
> > > PROCEDURE GET_USERS (USER_NAME IN CHAR,
> > > O_RESULT_SET OUT CURSOR_TYPE);
> > > END;
> > > /
> > > CREATE OR REPLACE
> > > PACKAGE BODY PACK1 AS
> > > PROCEDURE GET_USERS (USER_NAME IN CHAR,
> > > O_RESULT_SET OUT CURSOR_TYPE)
> > > AS
> > > BEGIN
> > > OPEN O_RESULT_SET FOR
> > > SELECT FULLNAME, PASSWORD
> > > FROM USER_INFO
> > > WHERE USERNAME = USER_NAME;
> > > END;
> > > END;
> > > /
> > >
> >
> > Your cursor O_RESULT_SET needs to be 'in out'
> >
> > As with all problems you should list the code ( as you did) plus the
> > error message. Often the error number is sufficient. More or too much
> > data is easy to ignore.
> >
> > It is possible/likely that no one who is reading this could reproduce
> > your specific error as they do not have your environment.
> >
> > > Sent via Deja.com
> > > http://www.deja.com/
> > >
> >
> > --
> > Michael Krolewski
> > Rosetta Inpharmatics
> > mkrolewski_at_rii.com
> > Usual disclaimers
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
>
> Sent via Deja.com
> http://www.deja.com/

Add/change

variable mycur refcursor
execute pack1.getusers('user2',mycar)
print mycur

Hth,

Sybrand Bakker, Oracle DBA Received on Thu Jan 25 2001 - 13:19:44 CST

Original text of this message

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