How to execute a procedure [message #396] |
Sat, 09 February 2002 09:28 |
Nathalie Harbonne
Messages: 8 Registered: February 2002
|
Junior Member |
|
|
How to execute a procedure
Can you tell me how to execute a procedure?
Once i have done the code, i want to execute a procedure(named for example proc13)but i don't succeed to.
If i do @proc13.sql i receive the message : it is impossible to open the sql file (with an extenstion .sql).
Can you explain me exactly how to execute a procedure please.
I have created o lot of procedure but i don't succeed to execute them, so it is very unpleasant.
Secondly, is it possible to take the code of a procedure and to put it in a simple pl/sql treatment.
Thirstly, when do we have to compile before executing, and how do we do to compile.
thanks a lot for all
Nathalie Harbonne
|
|
|
Re: How to execute a procedure [message #397 is a reply to message #396] |
Sat, 09 February 2002 15:52 |
sokeh
Messages: 77 Registered: August 2000
|
Member |
|
|
Nathalie:
When you use this command @proc13, you are just compiling your store proc.
You can use the execute command to invoke your stored proc.
eg execute proc13;
You can also use anonymous block to call your stored proc.
eg.
declare
begin
proc13;
end;
if you have arguments for your procedure
for instance
create or replace procedure proc13(arg_in in number,
arg_out out varchar2)as
begin
select name into arg_out
from yourtable
where id = arg_in;
end;
you can test this as:
set serveroutput on
declare
arg_in number;
arg_out varchar2(25);
begin
arg_in := 25;
proc13(arg_in, arg_out);
dbms_output.put_line('result is:'||arg_out);
end;
hope this helps you get started.
|
|
|