A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Oracler Date function
Joined: Dec 24, 2004
Sep 20, 2005 23:53:00
I have 3 columns in a table say, A_DATE, A_TIME and A_DATETIME. The data type for all the columns is DATE.
Now I want to take the date part from A_DATE, time part from A_TIME, and insert those date & time values into A_DATETIME.
I could get the date & time part from the 2 columns using to_char funtion, but I don't know how to merge them and put it in to the third column. Any suggestions.
Joined: Aug 13, 2004
Sep 21, 2005 01:57:00
I dont have database to
this but this works
INSERT INTO TABLE_NAME(A_DATETIME) SELECT TO_DATE(( (TO_CHAR(A_DATE,'DD/MM/YYYY') || ' ' || TO_CHAR(A_TIME,'HH24:MI:SS')),'DD/MM/YYYY HH24:MI:SS' ) as A_DATETIME FROM TABLE_NAME WHERE YOUR_CONDITION
Gravitation cannot be held responsible for people falling in love ~
Joined: Aug 15, 2004
Sep 21, 2005 04:26:00
You just want a query or you want it in your application. If its something your application needs to do then you had better do it in your code.
subject: Oracler Date function
Comparing 2 tables
conversion of string into java.util.Date
Regarding Bulk insert
Oracle Date problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014