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

Re: SQL LOADER Problem : WHEN CLAUSE NOT WORKING PROPERLY

From: Julian Goulet <jgoulet_at_whsun1.whoi.edu>
Date: 1998/07/13
Message-ID: <6ocub6$g7d4@dilbert.whoi.edu>#1/1

Do two into table clauses:

  INTO TABLE FORECAST_INFORMATION
  WHEN (1) = 'Y'
  ... other specs ...

  INTO TABLE FORECAST_INFORMATION
  WHEN (2) = 'Y'
  ... other specs ...

This assumes that 'Y' is only in column 1 or column 2

Julien Goulet

Umesh Limaye (ulimaye_at_poci.amis.com) wrote:
: 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
 

: -- SQL LOADER CONTROL FILE ------------------------------------
 
: 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 Mon Jul 13 1998 - 00:00:00 CDT

Original text of this message

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