Home » SQL & PL/SQL » SQL & PL/SQL » Imediate return to the calling program after starting a procedure
Imediate return to the calling program after starting a procedure [message #20883] Thu, 27 June 2002 06:16 Go to next message
Andy Douglas
Messages: 1
Registered: June 2002
Junior Member
I am using VB to call a procedure on the Database server. The procedure may take 2 - 3 hours to complete. I need to start this procedure and return to the VB program imediately. Is there a way to spawn a process on the server which could call the procedure and imediately return to the VB program?
Re: Imediate return to the calling program after starting a procedure [message #20888 is a reply to message #20883] Thu, 27 June 2002 09:00 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
I think your best option here is to use job scheduling in the database via DBMS_JOB. You can submit an entry into the job queue from VB and control will immediately pass back to VB. Meanwhile, via the job queue, the proc will run, and by not specifying an interval, the job will be deleted after it runs.

dbms_job.submit(:jobno, 'yourproc;');


where :jobno is a OUT parameter from the procedure indicating the job number assigned to your job. You can ignore this return value.
Re: Also [message #20889 is a reply to message #20888] Thu, 27 June 2002 09:01 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Make sure to commit after the call to dbms_job.submit.
Previous Topic: can nested tables increase the performance ?
Next Topic: Re: insert into ... (select from ...) problem
Goto Forum:
  


Current Time: Fri Apr 26 08:26:58 CDT 2024