Re: submit jobs
Date: Fri, 19 Nov 1999 08:22:43 GMT
Message-ID: <8131ch$8eq$1_at_nnrp1.deja.com>
In article <3833f228.0_at_news.kabsi.at>,
"Andreas Schwaiger" <andreas.schwaiger_at_strasser.at> wrote:
> hi all,
>
> i want to run a procedure as a job in the background
>
> i tried this:
> DBMS_JOB.SUBMIT(jobno,proc_name,sysdate+1/(25*60));
> nothing happens
>
> then I tried this:
> DBMS_JOB.SUBMIT(jobno,proc_name);
> DBMS_JOB.RUN(jobno,true);
>
> Now the procedure proc_name is running, but I have to wait until its
> finished.
> Who can help me?
>
> Andi Schwaiger
> Austria
>
>
Hi Andi.
Well, I tried this and it seems to work fine!
Write this piece of anonymous PL/SQL code (you may use SQLPLUS)
VARIABLE jobno number;
BEGIN
DBMS_JOB.SUBMIT (:jobno,
'BR2.INSERT_DEPT;', SYSDATE, 'SYSDATE +30/1440');
COMMIT;
END;
/
What does it mean? It's easy: you submit a job called BR2.INSERT_DEPT (it is a stored procedure created in a schema called BR2), and have Oracle run it now (SYSDATE) and every 30 minutes (SYSDATE + 30/1440).
Then, to see if everything works fine, just execute this simple query:
SELECT * FROM USER_JOBS;
Good luck!!!
Carlo
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Nov 19 1999 - 09:22:43 CET