Calling Procedure at (Form, Library and Database) level [message #500007] |
Thu, 17 March 2011 04:15 |
Manoj.Gupta.91
Messages: 239 Registered: March 2008 Location: Delhi
|
Senior Member |
|
|
Hi,
I've a procedure let us say SALES_PROC on Form Level and same procedure in Library and in Database also.
How to call SALES_PROC created at Form Level?
How to call SALES_PROC created at Library Level (.PLL)?
How to call SALES_PROC created as stored procedure in Database?
Thanks & Regards
Manoj
|
|
|
|
|
Re: Calling Procedure at (Form, Library and Database) level [message #500036 is a reply to message #500018] |
Thu, 17 March 2011 06:04 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
You just shouldn't have a system where you have the same procedure name at all three levels - it's just bad design.
If you don't use schema name you will not be able to call the db proc as the form proc will always take precedence.
The pll and db procs should always be within packages, then you can reference them by package name.
Basically forms looks in the form for a match, then any attached plls, then the db.
|
|
|
Re: Calling Procedure at (Form, Library and Database) level [message #500038 is a reply to message #500036] |
Thu, 17 March 2011 06:12 |
Manoj.Gupta.91
Messages: 239 Registered: March 2008 Location: Delhi
|
Senior Member |
|
|
Hi,
@cookiemonster
I know that I can call database stored procedure using Schema name.
This is bad design practive...I know. But this is still possible that we have a procedure with the same name at all three levels.
I've been asked this question so many times in interviews. I'm uable to find out a complete solution for this.
Please advise...
Thanks & Regards
Manoj
|
|
|
Re: Calling Procedure at (Form, Library and Database) level [message #500040 is a reply to message #500038] |
Thu, 17 March 2011 06:21 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
The complete solution is don't do it.
You can not call a db function if there is a form function of the same name (assuming they also have the same parameter list, if they don't it'll call whichever one matches the parameter list (probably - I haven't checked)) unless you use the schema name.
There is no way round this.
|
|
|