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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Define a job to run once an year

Re: Define a job to run once an year

From: Alan <not.me_at_rcn.com>
Date: Fri, 24 Dec 2004 21:22:29 -0500
Message-ID: <33417tF3taah1U1@individual.net>

"Sybrand Bakker" <sybrandb_at_hccnet.nl> wrote in message news:bejos0te3j7trn1ov63ch86u2na0dpeet7_at_4ax.com...
> On 24 Dec 2004 05:37:10 -0800, "Rauf Sarwar" <rs_arwar_at_hotmail.com>
> wrote:
>
> >
> >Robert Scheer wrote:
> >> Hi.
> >>
> >> I need to run a job once an year, more exactly on the last day of the
> >> year at 23:59. This job needs to drop a sequence and recreates it.
> >How
> >> can I configure the job to run at this exact moment in time?
> >>
> >> Thanks,
> >> Robert Scheer
> >
> >set serverout on
> >declare
> >job_ integer;
> >begin
> >dbms_job.submit(job_,
> >'your_proc(''parameters'');',
> >trunc(to_date('12/31'||to_char(sysdate, 'YYYY'),
> >'MM/DD/YYYY')) + 1439/1440,
> >'trunc(to_date(''12/31'' || to_char(sysdate + 1,
> >''YYYY''), ''MM/DD/YYYY'')) + 1439/1440');
> >commit;
> > dbms_output.put_line(to_char(job_));
> >end;
> >/
> >
> >Regards
> >/Rauf
>
> Why not resolve this using LAST_DAY and ADD_MONTHS, so the O/P learns
> something from it, and can address it on his own next year. Anyway, if
> it is really a once per year job, one wonders why he didn't use 2004
> to resolve it.

I wonder if there is a valid reason for him to be doing this. There is a good possibility of the all-too-common misuse of a sequence. Received on Fri Dec 24 2004 - 20:22:29 CST

Original text of this message

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