ORA-01846:不是一周中的有效日期

时间:2016-02-18 04:20:23

标签: oracle

    SQL> create or replace procedure test ( newcol in varchar2,fld_timestamp out timestamp ) as 
      2  begin
      3  fld_timestamp := to_timestamp_tz('newcol','DAY Mon DD hh24:mi:ss TZD YYYY');
      4  end;
      5  /

    Procedure created.

    SQL> declare
     2  fld_timestamp timestamp;
     3  begin
     4  test('WEDNESDAY Jan 13 16:29:00 EST 2016',fld_timestamp);
     5  end;
     6  /
    declare
   *
   ERROR at line 1:
   ORA-01846: not a valid day of the week
   ORA-06512: at "SANPALLE.TEST", line 3
   ORA-06512: at line 4

我创建了一个名为test的过程,将char数据转换为时间戳。我给予程序的输入格式正确,但我仍然得到"一周中无效的日期" ,有人可以告诉我我在哪里做错了吗?

1 个答案:

答案 0 :(得分:2)

删除"quote1" things in between "quote2"上的'引号。也请在格式中使用'newcol'代替TZR

应该是这样的:

TZD