Link to home
Start Free TrialLog in
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

asked on

PL/SQL: Need to call another proc and not wait around.

Is it possible to execute a stored proc from another and not wait around for it to finish?

Give the example below, I want to execute procB, which executes procA.  I do not want to wait the 5 seconds it takes for A before B returns.

create or replace procedure procA as
begin
      dbms_lock.sleep(5);
end;
/

show errors

create or replace procedure procB as
begin
      --need to exec procA and not wait for a response.
      procA;
end;
/

show errors

exec procA;
exec procB;
ASKER CERTIFIED SOLUTION
Avatar of earth man2
earth man2
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

ASKER

Hadn't thought about that approach.  Might work if that's all that's available.  I can see the logistics of that becoming a nightmare real quick......
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the posts thus far.  

I'd like to clarify a bit:  I have a stored procedure that is called from a web form.  It accepts data from the web form and performs some processing on it and eventually tucks it away safely into a table and releases the web form to continue it's processing.  I would now like to continue some additional processing and not hold up the web form while this processes.

I'm thinking the proper approach would be to implement workFlow but this seems like overkill for this.  Just hoping that I had overlooked something simple.
Just the sort of situation the simple daemon example in the web link I provided earlier is for. Workflow will do the job for you but is overkill for this when it is so easy to write a pipe based version using DBMS_PIPE.

I doubt you need anything so overblown but here we have re-written all of out asynchronus programming such as this from PL/SQL using DBMS_PIPE to using Microsoft BizTalk Server 2004 which does the job admirably.

Take a look at http://www.microsoft.com/biztalk

Regards

Chedgey
dbms_pipe is OK  for simple transactions.  Data in pipe is lost when system crashes.

May need to use DBMS_AQ.
Thanks to all who played along.  Not sure how I'm going to implement this (probably outside of Oracle)........