Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> SQL LOADER Problem : WHEN CLAUSE NOT WORKING PROPERLY
I am using the SQL Loader Control file attached below. Sample Data file is also included at the very end.
With this control file, I can not get first two rows in the table. I used to think that column spec. section is processed before applying 'WHEN' Clause. So, the read-value of IsForecast is processed by SQL Expression "RTRIM(LTRIM(:IsForecast))" and THEN tested for WHEN clause.
But, it seems like the read-value is checked for WHEN & then if it passes WHEN test "RTRIM(LTRIM(:IsForecast))" is applied.
I tried modifying WHEN clause to WHEN RTRIM(LTRIM(IsForecast))='Y' this is un-acceptable format & fails.
Any comments or suggestions, please e-mail them to ulimaye_at_poci.amis.com
Thanks.
Umesh
REPLACE
INTO TABLE FORECAST_INFORMATION
WHEN (IsForecast='Y')
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
(IsForecast CHAR "RTRIM(LTRIM(:IsForecast))", BU CHAR) -- ----------------- END OF CONTROL FILE --------------------
Data File is like this . . .
Few lines like first two shown here start with a leading space.
I am trying to figure out how to get them in.
Y,CA
Y,CA
Y,TGP Y,TGP Y,TGP ________________________________________
Umesh Limaye'
American Microsystems Inc.
2300 Buckskin Road
Pocatello, Idaho 83201
e-mail: ulimaye_at_poci.amis.com Received on Sat Jul 11 1998 - 00:00:00 CDT
![]() |
![]() |