| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sql Loader: Selective Import query.
Użytkownik punitparikh_at_gmail.com napisał:
> Hi Noel,
>
> Thanks for your reply. I have gone through various ways and syntax of
> the control file. Regarding selective loading I could figure out using
> Position(...) when the input is a data stream but for a delimited input
> file (csv in my case) I could not figure out how I can load only
> selective columns?
>
> Could you please provide some pointers as to how this can be done?
Ok. I tell you how to do it. (Since Oracle8i)
lets see on your input line.
'4/27/1998,506,23,M508 RCW,TESCO,,,,,295/80R22.5,295/80R22.5' Your line constains 10 columns, 8 has to be skipped. You said you need to load column 2 and 4.
CREATE TABLE PARTLOAD
(
col1 VARCHAR(10),
col2 VARCHAR2(50)
);
Now, how you should to build your control file:
[...]
INTO TABLE PARTLOAD
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(
a1 FILLER,
col1 char,
a2 FILLER,
col2 char,
a3 FILLER,
a4 FILLER,
a5 FILLER,
a6 FILLER,
a7 FILLER,
a8 FILLER,
-- NoelReceived on Wed May 18 2005 - 07:34:02 CDT
![]() |
![]() |