visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Databases :: Oracle :: oracle update datetime field format


By: Nono Great Britain  Date: 07/10/2005 10:51:05  English  Points: 20 Status: Answered
Quality : Excellent
how to update the datetime format of a field in an Oracle table ?
By: VGR Date: 07/10/2005 10:54:58 English  Type : Answer
In fact, you don't have to ;-)

Oracle knows only one format for datetimes, namely DATE (non-standard compliant) format, which hols in fact an SQL-92 DATETIME (+microseconds if I'm not mistaken)
It added DATETIME in subsequent versions (9?) but I'm not sure it's not simply an alias of the same datatype ;-)))

The recommended way of handling different date formats in Oracle is in the SELECTs... By using TO_CHAR() and TO_DATE() respectively...

like when selecting FROM the Oracle table :

select TO_CHAR(the_date_field,'YYYY-MM-DD HH24:MI:SS') from thetable;



or when updating the same table :

update thetable set thefield=TO_DATE('2005-05-27 00:00:01','YYYY-MM-DD HH24:MI:SS');



Regards

Do register to be able to answer

EContact
browser fav
page generated in 291.405920 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page