When clause in sqlldr [message #63415] |
Mon, 04 October 2004 03:52 |
Padmanathan
Messages: 2 Registered: February 2004
|
Junior Member |
|
|
Hi All:
Am having a file .csv with fields terminated by ','.
Eg Recordin csvfile:
21206,9231,category,methodCall,9/30/2004 8:57:00 PM,0,HS,09300460
In this I have filter out those records that have the time value less than 6 AM.
For this I used when clause, but am not successful as the sqlldr doesn't allows to use such kind of functions in when clause.
My Control file
load data
infile 'ifa.csv'
insert into table table_name
WHEN (TO_DATE(TO_CHAR(start_time,'hh AM'),'hh AM') <> TO_DATE('1 AM','hh AM')) AND (TO_DATE(TO_CHAR(start_time,'hh AM'),'hh AM') <> TO_DATE('2 AM','hh AM')) AND (TO_DATE(TO_CHAR(start_time,'hh AM'),'hh AM') <> TO_DATE('3 AM','hh AM')) AND (TO_DATE(TO_CHAR(start_time,'hh AM'),'hh AM') <> TO_DATE('4 AM','hh AM')) AND (TO_DATE(TO_CHAR(start_time,'hh AM'),'hh AM') <> TO_DATE('5 AM','hh AM'))
FIELDS TERMINATED BY "," TRAILING NULLCOLS
(a,b,c,d,e,f)
If any knows the solution please reply to this.
Thanks in advance,
Paddy.
|
|
|
Re: When clause in sqlldr [message #63440 is a reply to message #63415] |
Tue, 05 October 2004 03:49 |
Frank Naude
Messages: 4587 Registered: April 1998
|
Senior Member |
|
|
Hi,
As workaround, load all the data into a temporary table, then delete the unwanted records and add the remaining rows to the target table.
Best regards.
Frank
|
|
|