Home » SQL & PL/SQL » SQL & PL/SQL » Calling procedures
Calling procedures [message #188460] Fri, 18 August 2006 12:32 Go to next message
sweetgeegee27
Messages: 107
Registered: June 2005
Senior Member
How do you call a procedure in an else statement? Is it

If .... then
....
else <procedure>?
Re: Calling procedures [message #188462 is a reply to message #188460] Fri, 18 August 2006 12:44 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
The same as you do outside an IF statement.
Re: Calling procedures [message #188463 is a reply to message #188460] Fri, 18 August 2006 12:46 Go to previous messageGo to next message
Akshar
Messages: 116
Registered: May 2006
Senior Member



IF  CONDITION 1 THEN
    statement1;
ELSE
    
  myprocedure;

END IF;





Re: Calling procedures [message #188468 is a reply to message #188463] Fri, 18 August 2006 12:52 Go to previous messageGo to next message
sweetgeegee27
Messages: 107
Registered: June 2005
Senior Member
Ok...but I got an error message saying that I have to declare it. Where and how do I do that?
Re: Calling procedures [message #188469 is a reply to message #188468] Fri, 18 August 2006 12:54 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
I think this is the same error as you got in another post regarding the pre-query trigger.
You probably need a synonym and execute rights on the procedure. The procedure is owned by another user than you, right?
Re: Calling procedures [message #188470 is a reply to message #188460] Fri, 18 August 2006 12:54 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
When all else fails, read the fine PL/SQL User's Guide and Reference as found at
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
Re: Calling procedures [message #188475 is a reply to message #188469] Fri, 18 August 2006 13:12 Go to previous messageGo to next message
sweetgeegee27
Messages: 107
Registered: June 2005
Senior Member
That's right...the procedure is owned by someone else, but how do I create the synonym?
Re: Calling procedures [message #188477 is a reply to message #188475] Fri, 18 August 2006 13:15 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
That would be in the documentation. Read the first topic in the forum to see where to find the docs.
Re: Calling procedures [message #188760 is a reply to message #188460] Mon, 21 August 2006 09:35 Go to previous messageGo to next message
sweetgeegee27
Messages: 107
Registered: June 2005
Senior Member
No Message Body

[Updated on: Mon, 21 August 2006 09:38]

Report message to a moderator

Re: Calling procedures [message #188764 is a reply to message #188469] Mon, 21 August 2006 09:50 Go to previous messageGo to next message
sweetgeegee27
Messages: 107
Registered: June 2005
Senior Member
I have worked with other procedures that are not owned by me and they had no synonyms and I did not have a problem executing the script. I think that it is something else. My previous post was similar and all I did was expand the size of a field. I will try that. Thanks
Re: Calling procedures [message #188765 is a reply to message #188764] Mon, 21 August 2006 09:55 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
They may well have had public synonyms created for them.
If the procedure you want to execute is in another schema than yours, then the 3 ways of accessing it are:

1) Refer to it as Schema_name.procedure_name
2) Create a private synonym pointing to Schema_name.procedure_name.
3) Create a public synonym pointing to Schema_name.Procedure_name
Re: Calling procedures [message #188766 is a reply to message #188765] Mon, 21 August 2006 10:00 Go to previous message
sweetgeegee27
Messages: 107
Registered: June 2005
Senior Member
Thank you so much JRowbottom. I used the first option you pointed out for executing the procedure (schema_name.procedure_name) and it worked.

Thanks again.
Previous Topic: Reading XML help
Next Topic: FRM 40735 Pre Query trigger raised unhandled exception ORA 04067
Goto Forum:
  


Current Time: Sat Dec 07 02:41:20 CST 2024