cancel
Showing results for 
Search instead for 
Did you mean: 

execute stored procedure

Pieter_5
Advisor

execute stored procedure

Hi,

I just created a stored procedure which looks like this
myprocedure(inputvar In number , outputvar out varchar2)

I want to test this procedure with sqlplus. I tried it like like this;

var testvar varchar2(10);
exec myprocedure(333,testvar);

I get the message testvar not declared!!

How do I test this stored procedure correctly?

2 REPLIES
Brian Crabtree
Honored Contributor

Re: execute stored procedure

I prefer to use plsql to do this:

set serveroutput on
declare
testvar varchar2(10);
begin
execute myprocedure('333',testvar);
dbms_output.put_line('Testvar '||testvar);
end;
/

Thanks,

Brian
Yogeeraj_1
Honored Contributor

Re: execute stored procedure

hi,
*
i have it in your last post:
*
Testing using SQLPLUS:
=======================
scott@DEV.MU> variable name varchar2(10);
scott@DEV.MU> variable sal number;
scott@DEV.MU> exec emp_lookup('7782', :name, :sal);
-
PL/SQL procedure successfully completed.
-
Elapsed: 00:00:00.14
scott@DEV.MU> select :name, :sal
2 from dual;
-
:NAME :SAL
________________________________ __________
CLARK 2450
-
Elapsed: 00:00:00.01
scott@DEV.MU>
==========================================================
*
*
variable testvar varchar2(10);
exec myprocedure(333,:testvar);
*
to verify the value returned use:
select :testvar from dual;
*
*
you missed the ":"
regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)