Home » SQL & PL/SQL » SQL & PL/SQL » How to know a package is being called
How to know a package is being called [message #335315] Mon, 21 July 2008 18:03 Go to next message
dassudip
Messages: 22
Registered: February 2005
Location: Delhi
Junior Member

How can I ensure that initialization code of a package is called without requesting users of the package to call it directly?
Re: How to know a package is being called [message #335316 is a reply to message #335315] Mon, 21 July 2008 18:16 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & follow posting guidelines as stated in URL above

>How can I ensure that initialization code of a package is called without requesting users of the package to call it directly?

In other words, you are asking how to execute code without actually calling it. Right?

You need to make the code self-aware; so it always does the Right Thing!

Unfortunately for you there are no triggers on procedures.
Perhaps you should submit an enhancement request to Oracle that they add this feature to PL/SQL.

Alternatively, you could call the initialization code yourself at instance startup right after you pin the code in the SGA.

[Updated on: Mon, 21 July 2008 18:26] by Moderator

Report message to a moderator

Re: How to know a package is being called [message #335359 is a reply to message #335315] Mon, 21 July 2008 23:37 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
If the initialisation code of that package does anything else then preparing the package to run, then the design is flawed.
You should not have any code in package A's init-code that influences package B's behaviour, unless package B calls package A (which automagically runs A's init-code)
Re: How to know a package is being called [message #335583 is a reply to message #335315] Tue, 22 July 2008 17:32 Go to previous messageGo to next message
dassudip
Messages: 22
Registered: February 2005
Location: Delhi
Junior Member

dassudip wrote on Mon, 21 July 2008 19:03
How can I ensure that initialization code of a package is called without requesting users of the package to call it directly?




Hi,
If someone can please help on the following:
How can I ensure that initialization code of a package is called without requesting users of the package to call it directly?
Re: How to know a package is being called [message #335584 is a reply to message #335583] Tue, 22 July 2008 17:34 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & follow posting guidelines as stated in URL above

dassudip wrote on Tue, 22 July 2008 15:32
dassudip wrote on Mon, 21 July 2008 19:03
How can I ensure that initialization code of a package is called without requesting users of the package to call it directly?




Hi,
If someone can please help on the following:
How can I ensure that initialization code of a package is called without requesting users of the package to call it directly?



Alternatively, you could call the initialization code yourself at instance startup right after you pin the code in the SGA.
Alternatively, you could call the initialization code yourself at instance startup right after you pin the code in the SGA.
Alternatively, you could call the initialization code yourself at instance startup right after you pin the code in the SGA.
Alternatively, you could call the initialization code yourself at instance startup right after you pin the code in the SGA.
Alternatively, you could call the initialization code yourself at instance startup right after you pin the code in the SGA.

[Updated on: Tue, 22 July 2008 17:36] by Moderator

Report message to a moderator

Re: How to know a package is being called [message #335588 is a reply to message #335315] Tue, 22 July 2008 18:20 Go to previous messageGo to next message
dassudip
Messages: 22
Registered: February 2005
Location: Delhi
Junior Member

Hi,
Thank you very much. This solvs my problem,

Regards,
Re: How to know a package is being called [message #335630 is a reply to message #335315] Wed, 23 July 2008 00:52 Go to previous message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Initialization code is executed when each session references the package for the first time.

Regards
Michel
Previous Topic: Flattening the file
Next Topic: Primary key violation
Goto Forum:
  


Current Time: Tue Feb 11 20:04:38 CST 2025