Re: combining 2 DATE columns

From: Scott Mattes <ScottMattes_at_yahoo.com>
Date: Sat, 12 Jan 2002 02:55:55 GMT
Message-ID: <%AN%7.94$2t6.56330_at_news1.news.adelphia.net>


My SQL Loader is way rusty, but as far as combining them from a temp table you might try

to_date( to_char( field1, 'yyyy mm dd ' ) || to_char( field2, 'hh:mi:ss' ), 'yyyy mm dd hh:mi:ss' );

"Verna Legaspi" <vlegaspi_at_msn.com.no.spam.please> wrote in message news:uv7$eIumBHA.1816_at_cpimsnntpa02...
> Hello,
>
> I have a problem which, I believe, has 2 different solutions... I just
don't
> know how to implement either of them!
>
> I have a CSV flat file that I'd like to load into a table. Here's an
> example of the first 2 fields of this flat file:
> 01/07/2002,08:23:04,
> 01/07/2002,08:23:05,
> 01/07/2002,08:23:12,
> 01/07/2002,08:23:14,
> 01/07/2002,08:23:21,
> 01/07/2002,08:23:24,
> 01/07/2002,08:23:33,
> 01/07/2002,08:23:42,
> 01/07/2002,08:23:45,
> 01/07/2002,08:23:50,
>
> Attached is how they currently look in my DB.
>
> As you can see, they have separate "date" and "time" fields. I'd like to
> combine them into 1 DATE column in Oracle. What's the best way to do
this,
> and how?
>
> So far, I've tried concatenating them from SQL*Loader - but haven't had
much
> luck on composing the right control file. My other option was to load
them
> into a temp. table containing 2 DATE columns, and then concatenating them
> into 1 DATE column of the perm. table... but I can't figure out how to get
> rid of the extra "12:00:00" or "01/01/02." Is this even possible? I've
> played with TRIM & L/RTRIM but haven't had much luck... maybe it was just
> too late in the night. Or is there a magic function that does this that I
> don't know of??
>
> Any suggestions greatly appreciated! Please let me know if you need me to
> clarify or provide more info.
>
> TIA,
> Verna
>
>
>
>
>
>
>
>
>
>
>
Received on Sat Jan 12 2002 - 03:55:55 CET

Original text of this message