Alaska Cowboy
asked on
how to format timestamp data to insert to table
I am getting this data and want to format to insert to a timestamp field: 2011-03-31-14.38.07.004400
The vendor field format is CCYY-MM-DD-HH.MM.SS.MMMMMM
So I am testing with this data: 2011-03-31-14.38.07.004400 , which I've loaded to a character field.
how do I format "to_date" to then insert into a timestamp field?
This formatting works:
to_date(substr(ml.clm_adjd n_beg_tmst p,1,19),'y yyy-mm-dd- hh24.mi.ss ') returns 31-Mar-2011 2:38:07 PM
but how do I return "31-Mar-2011 2:38:07.000000 PM" ?
The vendor field format is CCYY-MM-DD-HH.MM.SS.MMMMMM
So I am testing with this data: 2011-03-31-14.38.07.004400
how do I format "to_date" to then insert into a timestamp field?
This formatting works:
to_date(substr(ml.clm_adjd
but how do I return "31-Mar-2011 2:38:07.000000 PM" ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
slightwv,
ok the first one worked anyway. I did not know about "to_timestamp", I've only used "to_date".
So I got it to work and will test it out more fully now.
curious - what does "FF" stand for ?
ok the first one worked anyway. I did not know about "to_timestamp", I've only used "to_date".
So I got it to work and will test it out more fully now.
curious - what does "FF" stand for ?
use the TO_TIMESTAMP conversion function
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ashilo - thanks
slightwv - thanks too.
I'll keep this open this afternoon if you don't mind, while I test out the insert via Pl*Sql
slightwv - thanks too.
I'll keep this open this afternoon if you don't mind, while I test out the insert via Pl*Sql
ASKER
all good ! thanks.
select to_char(
to_timestamp('2011-03-31-1
'DD-Mon-YYYY HH:MI:SS.FF AM'
)
from dual
/