Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

executing a procedure from within an anonymous pl/sql block

Status
Not open for further replies.

jimmy80

Programmer
May 7, 2003
13
GB
Hi I was wondering if anyone could help...
I'm trying to execute a stored procdure from within an anonymous pl/sql block.. something like
Declare
var1 NUMBER;
BEGIN
execute test_procedure ('param1', 'param2');
END;
but I get the a pl/sql error "expecting symbol :=, ...."

Is it possible to execute the procedure from within the pl/sql block and if so any ideas on what I'm doing wrong?

Thanks for your time,
Jimmy
 
Jimmy,

What you need is simply

[tt]Declare
var1 NUMBER;
BEGIN
test_procedure ('param1', 'param2');
END;
[/tt]
 
In fact execute command just wraps your procedure call in begin/end to get correct anonymous pl/sql block:

exec test <=> begin test; end;

Regards, Dima
 
hi jimmy,
when u r calling a stored procedure in pl/sql block then
there is no need of EXECUTE command ,it is used at that time when u execute a SP on sql propmt.
Simply use.....

begin
test_procedure('param1','param2');
end;
Thanks..
Regards
Shahzad Zafar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top