Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: hard code a submit date
jwa6 (jwagans_at_yahoo.com) wrote:
: I have a dbms job to run.
: The job is to be set up so that it runs on January 31st at 1:00am
: every year until the server fails....
: DBMS_JOB.SUBMIT(v_JobNum, -- Return of job number
: v_proc;', -- Procedure to submit
: v_run_date, -- Next ( JAN 31 2006
: 'add_months(sysdate,12)');- Interval - jan31,2007
: declare
: v_run_date DATE;
: begin
: v_run_date := add_months(LAST_DAY(TRUNC(sysdate)+(01+01/60)/24) +
: 0, 4);
: dbms_output.put_line('date --> '||to_char(v_run_date,'DD-MON-YYYY
: HH24:MI:SS'));
: end;
: /
: date --> 31-JAN-2006 01:01:00
: this gets me the date I want for v_run_date. But I need to hardcode
: v_run_date to the month I resubmit. ( the add_months part)
: if I hard code '31-JAN-06' IN v_run_date i GET AN ERROR SUBMITTING.
: Im trying to get the v_run_date to always be the next jan31 date
: regardless of the month it is when the process is submitted..... for
: whatever reason.
Not quite sure what you're saying, but I think you mean that something like
v_run_date := add_months(LAST_DAY(TRUNC('31-JAN-06')...
doesn't work, in which case perhaps you should use
... TRUNC( to_date('31-JAN-06','DD-MON-YY') ) ...
_BUT_ read the docs on the date format cause that may well be the wrong set of letters.
-- This programmer available for rent.Received on Tue Sep 20 2005 - 18:05:35 CDT
![]() |
![]() |