Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle job question

Re: Oracle job question

From: awebguru <chris.schneider_at_webanation.com>
Date: 15 Dec 2006 06:59:19 -0800
Message-ID: <1166194759.134159.38370@f1g2000cwa.googlegroups.com>


Sure - easy to do. Here are a few changes you need to make.

CREATE OR REPLACE PROCEDURE CLEAN IS
BEGIN
  /* Put your code here - whatever you are trying to do. */   COMMIT;
END CLEAN;
/

DECLARE
  X NUMBER;
BEGIN
  SYS.DBMS_JOB.SUBMIT

    ( job       => X
     ,what      => 'CLEAN;'
     ,next_date => to_date('15/12/2006 7:00:00','dd/mm/yyyy
hh24:mi:ss')
     ,interval  => 'SYSDATE + 1/1440'
     ,no_parse  => TRUE

    );
  SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x)); END;
/

commit;
Jun wrote:
> Hi Guys,
>
> I am using Oracle 9i and I am new to Oracle job, I created a procedure
> called 'CLEAN'
>
> and I used the following procedure to test my job.
>
> create or replace PROCEDURE TESTING AS
> JobNo user_jobs.job%TYPE;
>
> BEGIN
> dbms_job.SUBMIT(JObNO,'begin CLEAN; end;', sysdate,'SYSDATE +
> 1/1440');
> commit;
> END;
>
> it should run the job every minute but seems it is not working. what's
> wrong with it?
> and How can I set the job to be run every 4 hours between 8am and 8pm
> everyday?
> Any help or example would be highly appreciated.
Received on Fri Dec 15 2006 - 08:59:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US