ORA-01861: literal does not match format string [message #616683] |
Thu, 19 June 2014 12:38 |
theladyd
Messages: 13 Registered: September 2008
|
Junior Member |
|
|
I'm trying to update a date column in my table
DMS_BIRTH_DT2 is a subset of DMS_BIRTH_DT with the same formats.
Would someone tell me why the query works on DMS_BIRTH_DT2 and not DMS_BIRTH_DT?
UPDATE BIRTH_DT_TEST2
SET DMS_BIRTH_DT = to_date(substr(to_char(DMS_BIRTH_DT,'mmddyyyy'),1,4)||2099 , 'mm/dd/yyyy HH:MI:SS AM')
20 rows updated
UPDATE BIRTH_DT_TEST
SET DMS_BIRTH_DT = to_date(substr(to_char(DMS_BIRTH_DT,'mmddyyyy'),1,4)||2099 , 'mm/dd/yyyy HH:MI:SS AM')
ORA-01861: literal does not match format string
|
|
|
Re: ORA-01861: literal does not match format string [message #616686 is a reply to message #616683] |
Thu, 19 June 2014 12:46 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
06192099 would the your string for today. It doesn't match your mask.
You seem to have made a really complicated formula, mixing character string and numbers. i'm surprised the first one worked.
You should not be appending a string to a number. they are different datatypes.
Look at this:
select to_char(sysdate,'mmdd') || '2099' from dual;
[Updated on: Thu, 19 June 2014 12:50] Report message to a moderator
|
|
|
|
|
|