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 -> SQL LOADER Problem : WHEN CLAUSE NOT WORKING PROPERLY

SQL LOADER Problem : WHEN CLAUSE NOT WORKING PROPERLY

From: Umesh Limaye <ulimaye_at_poci.amis.com>
Date: 1998/07/11
Message-ID: <35A7A38F.168146B5@poci.amis.com>#1/1

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

LOAD DATA
INFILE 'M:\DATA\ACTUAL~1\Forecast\forecast.CSV'

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

Original text of this message

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