Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to insert a timestamp value

_AZ_Aug 1 2017 — edited Aug 2 2017

Hello,

how do i preserve the miliseconds information from the char type value in the "insert" statement?

Code:

create table abc ( ts timestamp )

insert into abc values( cast ( to_date( :ts,'YYYY/MM/DD HH24:MI:SS.FF') as timestamp) )

where ts can have from 2 to 6 positions after  "seconds" - e.g.  ='2017/08/01 14:53:20.573612' or '2017/08/01 14:53:20.57'

As expected the "insert" is chopping off the microseconds information. something i want to preserve very much ....

thank you

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 30 2017
Added on Aug 1 2017
5 comments
44,368 views