Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: sqlldr & Date/time

Re: sqlldr & Date/time

From: Ed prochak <ed.prochak_at_alltel.com>
Date: 11 Mar 2002 13:52:02 -0800
Message-ID: <e51b160.0203111352.2275b09d@posting.google.com>


ktyson9426_at_aol.com (KTyson9426) wrote in message news:<20020309173328.19833.00000556_at_mb-cc.aol.com>...
> Hello.... And thank you in adnvace for anyones help
>
> I want to use sqlldr to load the date/time into the same date field in my
> table. I can get the date in there ok, and I can get the time in with the use
> of a different field, but I can't find anything that tells me how to do get the
> date/time in the same field. I've found how to do this with an 'insert'
> statement, but I need to use sqlldr..... Can anyone tell me how to format the
> *.ctl file? Currently I have;
>
> load data
> infile *
> append into table vmstat
> fields terminated by ","
> (ddate, ttime, vmstat)
> begindata
> 30-Jan-02, 0122, 'data'

You may ba able to use a SQL expression. I did this: create table vmstat (
ddate DATE, ttime CHAR(10), vmstat VARCHAR(20) );

I ran this control file:
load data
infile *
append into table vmstat
fields terminated by ","
 (ddate DATE "TO_DATE( :ddate||' '||:ttime, 'dd-mon-yy hhmi')",   ttime CHAR,
  vmstat CHAR)
begindata
30-Jan-02, 0122, 'data'

which loaded one recorded that looked like this: select * from vmstat ;

DDATE                 TTIME      VMSTAT
--------------------- ---------- ------------------------------
Jan302002 01:22:00 AM  0122       'data'

HTH,
  Ed Prochak

This does have me wondering: What if there is no TTIME column in the table? Can SQL*Loader handle that and how would the control file look?? Received on Mon Mar 11 2002 - 15:52:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US