RE: migrating a date and varchar field into 1 date field

  • From: "Powell, Mark D" <mark.powell@xxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 9 Jul 2004 11:55:29 -0400

If you have already loaded the table it reads to me like all you need to do
is update the date_col for the time value held in the varchar2 column.  If
the time is formatted like "12:15:30" then something like:

update my_table
set date_col = to_date(to_char(date_col,'YYYYMMDD')||' '||
time_col,'YYYYMMDD HH24:MI:SS')
where ......

Depending on the exact format of the data, and my nearly limitless ability
to mistype statements some minor modification may be required.

HTH -- Mark D Powlel --


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of
ryan.gaffuri@xxxxxxxxxxx
Sent: Friday, July 09, 2004 11:46 AM
To: oracle-l@xxxxxxxxxxxxx
Subject: migrating a date and varchar field into 1 date field


I'm migrating some old data from a progress database. I was given a data
extract that was sql loaded into Oracle. I have two columns
date_col (has the proper month,day,year) and is a date type
time_col(has the proper time in minutes, seconds, etc...) and is a varchar
field
anyway to dummy it up so I can get both of these into the same column? the
date_col has an incorrect time of day. 
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: