Home » SQL & PL/SQL » SQL & PL/SQL » How to execute a procedure from within a package?
How to execute a procedure from within a package? [message #304999] Fri, 07 March 2008 08:05 Go to next message
hedonist123
Messages: 119
Registered: August 2007
Senior Member
Hi,

Could someone tell me How to execute a procedure from within a package?

I used execute proc_1(var1);

However, it gives me this error


Error: PLS-00103: Encountered the symbol "proc_1" when expecting one of the following:

:= . ( @ % ; immediate
The symbol ":=" was substituted for "proc_1" to continue.
Line: 31
Text: EXECUTE proc_1(var1);

Could you please help me out?

Thanks
Re: How to execute a procedure from within a package? [message #305000 is a reply to message #304999] Fri, 07 March 2008 08:08 Go to previous messageGo to next message
xenium
Messages: 25
Registered: February 2008
Location: Leuven Belgium
Junior Member
Use:

exec package.procedure(variables);

Greetings
Re: How to execute a procedure from within a package? [message #305001 is a reply to message #304999] Fri, 07 March 2008 08:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
"execute" is a SQL*Plus command not a PL/SQL one.
Just name the procedure you want to execute.

Regards
Michel
Re: How to execute a procedure from within a package? [message #305002 is a reply to message #304999] Fri, 07 March 2008 08:09 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
Don't use execute, and call it via package.procedure.

Answer may not be correct as you didn't give much information like how you called it, how the package was called, etc.
Re: How to execute a procedure from within a package? [message #305004 is a reply to message #305002] Fri, 07 March 2008 08:18 Go to previous messageGo to next message
hedonist123
Messages: 119
Registered: August 2007
Senior Member
The procedure that I am trying to call is not part of another package.

It is a stand alone procedure.

Michel,

I am trying to call this procedure within a package pack1

If I just name the procedure like this

proc_1(var1);

it throws me this error

Error: PLS-00323: subprogram or cursor 'pack1' is declared in a package specification and must be defined in the package body



Re: How to execute a procedure from within a package? [message #305018 is a reply to message #305004] Fri, 07 March 2008 09:32 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
PLS-00323: subprogram or cursor "string" is declared in a package specification and must be defined in the package body
Cause: A subprogram specification was placed in a package specification, but the corresponding subprogram body was not placed in the package body. The package body implements the package specification. So, the package body must contain the definition of every subprogram declared in the package specification.
Action: Check the spelling of the subprogram name. If necessary, add the missing subprogram body to the package body.


Regards
Michel
Previous Topic: SQL QUERY - URGENT please help
Next Topic: Need a "Select" Before "Cursor"
Goto Forum:
  


Current Time: Sat Dec 03 14:00:14 CST 2016

Total time taken to generate the page: 0.12855 seconds