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 -> hard code a submit date

hard code a submit date

From: jwa6 <jwagans_at_yahoo.com>
Date: 20 Sep 2005 13:49:29 -0700
Message-ID: <1127249369.297977.147890@g14g2000cwa.googlegroups.com>


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.

jim Received on Tue Sep 20 2005 - 15:49:29 CDT

Original text of this message

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