
How do you return values with Procedures?
(if that email address didn't require changing)
Quote:
> 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;
>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
dbms_output.put_line( 'the id = ' || l_id );
end;
/
might be a good way to test it. Or
SQL> variable id number
PL/SQL procedure successfully completed.
SQL> print id
ID
----------
5
would be another way.
Quote:
>What am I doing wrong?
>Thanks,
>Sean Dolan
Thomas Kyte
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