Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*Loader question

Re: SQL*Loader question

From: Michael Austin <maustin_at_firstdbasource.com>
Date: Sat, 20 Apr 2002 22:25:22 -0400
Message-ID: <3CC22312.CEF3458C@firstdbasource.com>


Laurent wrote:
>
> Hello,
>
> Is it possible to concatenate many fields into one field from a delimited input
> file.
>
> eg I have 3 fields in my text file and I would want to concatenate these 3
> fields into one column in my target ORACLE table.
>
> ":field1", ":field2", "field3" => Columnn 1
>
> Thanks in advance.
>
> --
> Use our news server 'news.foorum.com' from anywhere.
> More details at: http://nnrpinfo.go.foorum.com/

One way (such that you can use the DIRECT method) is to massage the data using a perl or shell script prior to loading. I have not had the pleasure of trying to concatenate fields on the fly in sql*loader but should be an interesting exercise...

I do not have a system I can try this on at the moment, but maybe you do..

LOAD DATA

        APPEND INTO TABLE t1
        (
        col1 CHAR TERMINATED BY "," ENCLOSED BY '"',
        col2 CHAR TERMINATED BY "," ENCLOSED BY '"' ||
        col3 CHAR TERMINATED BY "," ENCLOSED BY '"',
        col4 CHAR TERMINATED BY "," ENCLOSED BY '"'
         )

col2 and col3 should get concatenated if SQL*loader supports this feature.

-- 
Regards,

Michael Austin            Registered Linux User #261163
First DBA Source, Inc.    http://www.firstdbasource.com
Received on Sat Apr 20 2002 - 21:25:22 CDT

Original text of this message

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