Databases :: Oracle :: oracle update datetime field format |
|||
| By: Nono |
Date: 07/10/2005 10:51:05 |
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 | 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 |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








