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: Newbie question, I think

Re: Newbie question, I think

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 04 Feb 2000 08:26:07 -0500
Message-ID: <5pkl9ssbe862hhtrndb5h94efk7nh97s3f@4ax.com>


A copy of this was sent to i.p.kok02_at_kpn.com (M Ivon M) (if that email address didn't require changing) On Fri, 04 Feb 2000 08:34:58 GMT, you wrote:

>Hi all.
>
>I'm trying to submit a job by executing the following command:
>DBMS_JOB.SUBMIT(NEWJOBNUM,
> 'NAMEOFPROCEDURE;',
> SYSDATE + 5/(24*60),
> 'NEXT_DAY(TRUNC(SYSDATE), ''MONDAY'') + 22/24');
>
>The error message I get says 'not a valid day of the week'.
>I tried MONDAY, Monday, monday and MON.
>
>What is wrong?
>
>M Ivon M

What nls_language are you using? Consider:

ops$tkyte_at_8i> declare
  2 newjobnum number;
  3 begin
  4 DBMS_JOB.SUBMIT(NEWJOBNUM,

  5                                  'null;',
  6                                  SYSDATE + 5/(24*60),
  7                                  'NEXT_DAY(TRUNC(SYSDATE), ''MONDAY'') +
22/24');
  8
  9 rollback;
 10 end;
 11 /

PL/SQL procedure successfully completed.

ops$tkyte_at_8i> alter session set nls_language = 'FRENCH'; Session altered.

ops$tkyte_at_8i>
ops$tkyte_at_8i> declare
  2 newjobnum number;
  3 begin
  4 DBMS_JOB.SUBMIT(NEWJOBNUM,

  5                                  'null;',
  6                                  SYSDATE + 5/(24*60),
  7                                  'NEXT_DAY(TRUNC(SYSDATE), ''MONDAY'') +
22/24');
  8
  9 rollback;
 10 end;
 11 /
declare
*
ERROR at line 1:
ORA-01846: not a valid day of the week
ORA-06512: at "SYS.DBMS_JOB", line 50
ORA-06512: at "SYS.DBMS_JOB", line 138
ORA-06512: at line 4


ops$tkyte_at_8i> 

ops$tkyte_at_8i>
ops$tkyte_at_8i> declare
  2 newjobnum number;
  3 begin
  4 DBMS_JOB.SUBMIT(NEWJOBNUM,
  5                                  'null;',
  6                                  SYSDATE + 5/(24*60),
  7                                  'NEXT_DAY(TRUNC(SYSDATE), ''Lundi'') +
22/24');
  8
  9 rollback;
 10 end;
 11 /

PL/SQL procedure successfully completed.

ops$tkyte_at_8i>
ops$tkyte_at_8i> alter session set nls_language = 'AMERICAN'; Session altered.

When the language is 'french' for example, i must use Lundi which is Monday....

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Feb 04 2000 - 07:26:07 CST

Original text of this message

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