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 -> Trim Leading Blanks With Sql Loader

Trim Leading Blanks With Sql Loader

From: Val <vegas_girlie_at_hotmail.com>
Date: 8 Jul 2003 09:30:40 -0700
Message-ID: <7d04f924.0307080830.521d97ef@posting.google.com>


I am having a problem loading in records from a flat file where there are leading blanks. In our table those columns are defined as char(1). In the flat file the fields are coming in with 4 blank spaces and 1 char OR all blank spaces. I have tried the trim funtion and it doesnt seem work. Please help! Below is my control file with the input records...

LOAD DATA INTO TABLE "test"
TRUNCATE
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
(A DATE 'DD-MM-YYYY' NULLIF CRT_DT=BLANKS,    B,
   C,
   D NULLIF D=BLANKS,

   E, 
   F, 
   G, 
   H, 
   I, 
   J, 
   K, 
   L, 
   M, 
   N, 
   O, 
   P, 
   Q, 
   R char(1) "decode(LTRIM(R),NULL,NULL,LTRIM(r))",
   S char(1) "decode(LTRIM(S) ,NULL,NULL)",
   T char(1) "decode(LTRIM(T),NULL,NULL)",    U char(1) "decode(LTRIM(U),NULL,NULL)")

06-11-2003| 5| AT_BASE_EE| | | licdfe_at_choree.net| F| sam| Licye| 1234 Avvvehjem ST| | McVarlane| CA| 94111| | Y| | Y| Y| | Y
06-11-2003| 5| AT_BASE_EE| | | ALE00_at_yahoo.com| F| BOB Ling| Fong| 15 Nohrow Street| Apt. 123| New York| MI| 12345| | Y| | Y| | | Received on Tue Jul 08 2003 - 11:30:40 CDT

Original text of this message

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