vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I am trying to submit a dbms job to run on the last day of every month starting at 31 Dec at 18:30 using the following code: set serveroutput on declare jobno number; begin dbms_job.submit (jobno,'glossi_audit.entry_job',TO_DATE('31-Dec-2002 18:30:00','DD-MON-YYYY HH24:MI:SS'),LAST_DAY(TRUNC(sysdate)), false); commit; end; This fails with SQL> @rb1.sql 7 / declare * ERROR at line 1: ORA-23319: parameter value "31/dec/2002" is not appropriate ORA-06512: at "SYS.DBMS_JOB", line 57 ORA-06512: at "SYS.DBMS_JOB", line 134 ORA-06512: at line 4 Which I narrowed down to the value of the 'interval' parameter. I tried changing the NLS_DATE_FORMAT environment but it still fails. Can anyone tell me the what I can do to make it work ? I am running Oracle 9.2.0.2 on Sun Sparc Solaris 2.6 Thanks Rich |
| ||||
| Thanks - that worked Anton Buijs wrote: > Two things are wrong: > a. the what parameter must end with a ";" > so make it 'glossy_audit.entry_job;' > b. the interval parameter must be a varchar2 and must therefore be enclosed > in single quotes and make it 'LAST_DAY(TRUNC(sysdate))+18.5/24' so it will > return the proper day and time. > I think that must do it, without testing it myself. > > rb <rich.bevan@bt.com> schreef in berichtnieuws 3E1020F1.4D79BE79@bt.com... > | I am trying to submit a dbms job to run on the last day of every month > | starting at 31 Dec at 18:30 using the following code: > | > | set serveroutput on > | declare > | jobno number; > | begin > | dbms_job.submit > | (jobno,'glossi_audit.entry_job',TO_DATE('31-Dec-2002 > | 18:30:00','DD-MON-YYYY HH24:MI:SS'),LAST_DAY(TRUNC(sysdate)), false); > | commit; > | end; > | > | This fails with > | SQL> @rb1.sql > | 7 / > | declare > | * > | ERROR at line 1: > | ORA-23319: parameter value "31/dec/2002" is not appropriate > | ORA-06512: at "SYS.DBMS_JOB", line 57 > | ORA-06512: at "SYS.DBMS_JOB", line 134 > | ORA-06512: at line 4 > | > | Which I narrowed down to the value of the 'interval' parameter. I tried > | changing the NLS_DATE_FORMAT environment but it still fails. Can anyone > | tell me the what I can do to make it work ? > | > | I am running Oracle 9.2.0.2 on Sun Sparc Solaris 2.6 > | > | Thanks > | > | Rich > | > | |