Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: schedule job every month 12:00 pm
"sanjeev" <sanjeev_atvankar_at_yahoo.co.in> schreef in bericht
news:1147068407.538676.42710_at_y43g2000cwc.googlegroups.com...
>I am developing an application in which i need to transfer data from
> one table to another table within same schema in ORACLE 9i.
>
> transfer period = month end (12:00 am)
> i.e. data will be transfer on last date of every month at 12:00 mid
> night
> e.g.
> IF month is janaury then transfer at 31-01-06 (12:00 am)
> month is february then transfer at 28-02-06/29-02-06 (12:00
> am)
> month is march then transfer at 30-01-06 (12:00 am)
> --
> ----
> ----
> and so on.............
> for above problem i am using DBMS_JOB for scheduling.
> my code is as follows
> declare
> v_job number;
> begin
> dbms_job.submit(
> v_job,
> 'consolidate; end;',
> sysdate,
> 'sysdate+2/24'
> );
> end;
> so what is the value of 'INTERVAL:' parameter for above situation so
> that it can handle leap/non leap problem.
>
Why not for each month first get the first day of next month and then
subtract one day?
So to get the schedule for end of may, start with june 1th 12:00 am and
subtract 24 hours.
HTH.
-- JeroenReceived on Mon May 08 2006 - 17:09:39 CDT