Home » Developer & Programmer » Forms » Calling Procedure at (Form, Library and Database) level
Calling Procedure at (Form, Library and Database) level [message #500007] Thu, 17 March 2011 04:15 Go to next message
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 #500016 is a reply to message #500007] Thu, 17 March 2011 04:34 Go to previous messageGo to next message
infosuresh2k
Messages: 77
Registered: September 2009
Location: CHENNAI, INDIA
Member

Hi,

If you have same procedure sale_proc in pll, program unit and database level then you have to call like below

1.database sale_proc you can call with schema name like scott.sale_proc

2. if you have same procedure in pll and program unit then it will take program unit sale_proc only not from pll proc(program unit is first priority is both procedures are same).

Regards,
Suresh.V
Re: Calling Procedure at (Form, Library and Database) level [message #500018 is a reply to message #500016] Thu, 17 March 2011 04:42 Go to previous messageGo to next message
Manoj.Gupta.91
Messages: 239
Registered: March 2008
Location: Delhi
Senior Member
Hi,

(1) I don't want to use schema name in any context.
(2) Although this is not a general scenario but still want to know calling method for all 3 procedures separately.


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 Go to previous messageGo to next message
cookiemonster
Messages: 13938
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 Go to previous messageGo to next message
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 Go to previous message
cookiemonster
Messages: 13938
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.
Previous Topic: changes made in forms not getting effected in front end
Next Topic: ORA-00001: unique constraint
Goto Forum:
  


Current Time: Mon Sep 16 13:06:58 CDT 2024