Connecting Tech Pros Worldwide Forums | Help | Site Map

How can we Check if Oracle stored procedure already running

Newbie
 
Join Date: Oct 2009
Posts: 4
#1: 2 Weeks Ago
Hi all ,
Please help me on the the following query
How can we Check if Oracle stored procedure already running

nbiswas's Avatar
Member
 
Join Date: May 2009
Location: India
Posts: 33
#2: 2 Weeks Ago

re: How can we Check if Oracle stored procedure already running


The easiest way is to wrap the procedure in a package, and have it set
a variable defined in the package spec.
Other invocations of the procedure would need to verify whether the
variable was already set.

Another solution

Assuming you are talking about it being run
in the current session: Here's another.

DBMS_APPLICATION_INFO.SET_CLIENT_INFO
DBMS_APPLICATION_INFO.GET_CLIENT_INFO

Obtained from [Link Removed]

Hope this helps
Newbie
 
Join Date: Oct 2009
Posts: 4
#3: 2 Weeks Ago

re: How can we Check if Oracle stored procedure already running


Thanks for your valuable suggestion.
I have wrapped my procedure in a package with package variable (packageVar number := 0;).And in Package body in procedure definition ,checking packageVar value.
If it is 0 ,
Asigned it as 1 and Continued with procedure steps
Assigned packageVar as 0 ///End of procedure
else
Returning from the procedure without doing anything

But I am keeping a log to check packageVar value.Always it is getting as 0.So my doubt is will this package variable be initialised only once or for each invocation of procedure ,will it be intialised?
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#4: 2 Weeks Ago

re: How can we Check if Oracle stored procedure already running


How are you trying to execute a procedure? via some application or invoking it manually from sql editor?
Reply