Re: DBMS_JOB example
Date: 1996/11/09
Message-ID: <32850A56.30B5_at_post3.tele.dk>#1/1
N Prabhakar wrote:
>
> I have read the documentation of DBMS_JOB, but not able to figure out a
> live example in any of the manuals.There are a couple of examples in the App Developers Guide
in the Packages section (at least in the 7.3 doc set).
Otherwise see "Oracle PL/SQL" by Steven Feuerstein (published
by O'Reilly & Associates - a nice book!)
> If I want to execute a job every 30 minutes, (this job is nothing but a
> stored procedure), how to do it.
>
> Can any of the DBMS_JOB gurus give me a example of how to do this.This should do the trick:
DECLARE
jobno BINARY_INTEGER;
BEGIN
DBMS_JOB.SUBMIT(jobno, 'your_procedure_here;', SYSDATE, 'SYSDATE+1/48');
END;
Note a few things:
- the first parameter is an _output_ variable that the job no. is returned to - the second parameter must be in ' and end with ; - the third paramter is the first time to run. You don't need to put sysdate here - the fourth parameter must be in '. The addition is in days, ie. 1 is every day,1/24 is every hour, 1/48 is every half hour.
Best regards and good luck,
Sten Vesterli
Systems Engineer
TPI - Tom Pedersen International A/S
sev_at_tpi.dk
Received on Sat Nov 09 1996 - 00:00:00 CET