Avatar of smalig
smalig
 asked on

oracle sql

Hello experts,
I need to insert a value that is from a to_date function to a timestamp column

ex: i have this select statement -- select TO_DATE(substr(M."LASTUPDATETIME",1,19),'YYYY-MM-DD HH24:MI:SS') from a

I need to insert this value to a timestamp(0) column.

the output from the select is --  2015-06-30 05:21:55

and when I insert it to the timestamp column it becomes --  0030-06-15 00:00:00


how can I fix this?
thanks for your help.
Oracle DatabaseSQL

Avatar of undefined
Last Comment
Mark Geerlings

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
slightwv (䄆 Netminder)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Mark Geerlings

I agree that this is most likely caused by an implicit datatype conversion, or an incorrect format mask somewhere if you use explicit datatype conversions.

What do these queries return in your system?

select sysdate from dual;

select systimestamp from dual;
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy