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: How do you return values with Procedures?

Re: How do you return values with Procedures?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 23 Feb 1999 19:22:20 GMT
Message-ID: <36d4ff6a.1921422@192.86.155.100>


A copy of this was sent to dolans_at_stripe.Colorado.EDU (Sean Dolan) (if that email address didn't require changing) On 23 Feb 99 19:06:28 GMT, you wrote:

> I have a simple procedure that takes in a VARCHAR2 and outputs a number while doing an insert:
>(id out NUMBER, email in VARCHAR2)
>IS
>BEGIN
> select foo_seq.nextval into id from dual;
> insert into foo(id, email, visit_date)
> values(id, email, sysdate);
>end;
>
> So when I call it, I use "exec testDemo('me_at_here.com');" and I get the error:
>ORA-06550: line 1, column 7:
>PLS-00306: wrong number or types of arguments in call to 'TESTDEMO'
>ORA-06550: line 1, column 7:
>PL/SQL: Statement ignored
>

you need to send it 2 parameters. for example:

declare

   l_id number;
begin

   testDemo( l_id, 'me_at_here.com' );
   dbms_output.put_line( 'the id = ' || l_id ); end;
/

might be a good way to test it. Or

SQL> variable id number
SQL> exec testdemo( :id, 'me_at_here.com' );

PL/SQL procedure successfully completed.

SQL> print id

        ID


         5

would be another way.
>What am I doing wrong?
>
>Thanks,
>Sean Dolan
>sean_at_3si.com
 

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

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue Feb 23 1999 - 13:22:20 CST

Original text of this message

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