Home » SQL & PL/SQL » SQL & PL/SQL » execute stored procedure
execute stored procedure [message #218352] Wed, 07 February 2007 17:30 Go to next message
moshe
Messages: 1
Registered: February 2007
Junior Member
Hi,

I create a stored procedure in oracle and try to execute, during the execution occurred error. I am newbie in oracle.. Please Could you help me for command is necessary to execute this procedure in oracle client?

======== Store Procedure =====

CREATE OR REPLACE PROCEDURE TEST.SOMA
( P1 IN number, P2 IN number, RET out number)
IS
v_valor number := 0;

BEGIN
v_valor := p1 + p2;

RET := v_valor ;

END;

=====Command for execute the Stored Procedure using Oracle Client
SQL> EXEC TEST.SOMA(1,2);

=====ERROR DURING THE EXECUTION
BEGIN test.soma(1,2); END;

*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'SOMA'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

=============================================================
My idea is send a value 1 and 2 for the procedure return the value 3. I need the step by step to execute the procedure..

Thanks,
Moshe
Re: execute stored procedure [message #218367 is a reply to message #218352] Wed, 07 February 2007 21:05 Go to previous message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
You need to pass 3 args. Since the 3rd arg is an OUT param, it must be a bind variable if you are going to use EXEC.


VARIABLE RET NUMBER
EXEC TEST.SOMA(1,2, :RET);
PRINT :RET


Ross Leishman
Previous Topic: Duplicate Records
Next Topic: Convert multiple rows to one row
Goto Forum:
  


Current Time: Mon Dec 05 12:42:31 CST 2016

Total time taken to generate the page: 0.22300 seconds