Oracle date format picture ends before converting entire input string

前端 未结 4 1158
南方客
南方客 2021-01-11 09:55

My table has two DATE format attributes, however, when i try to insert value it throws an error: date format picture ends before converting entire input string.

相关标签:
4条回答
  • 2021-01-11 10:15

    Perhaps you should check NLS_DATE_FORMAT and use the date string conforming the format. Or you can use to_date function within the INSERT statement, like the following:

    insert into visit
    values(123456, 
           to_date('19-JUN-13', 'dd-mon-yy'),
           to_date('13-AUG-13 12:56 A.M.', 'dd-mon-yyyy hh:mi A.M.'));
    

    Additionally, Oracle DATE stores date and time information together.

    0 讨论(0)
  • What you're trying to insert is not a date, I think, but a string. You need to use to_date() function, like this:

    insert into table t1 (id, date_field) values (1, to_date('20.06.2013', 'dd.mm.yyyy'));
    
    0 讨论(0)
  • 2021-01-11 10:33

    I had this error today and discovered it was an incorrectly-formatted year...

    select * from es_timeexpense where parsedate > to_date('12/3/2018', 'MM/dd/yyy')
    

    Notice the year has only three 'y's. It should have 4.

    Double-check your format.

    0 讨论(0)
  • 2021-01-11 10:39

    you need to alter session

    you can try before insert

     sql : alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'
    
    0 讨论(0)
提交回复
热议问题