Re: SQLLDR reusing column records

From: Turkbear <john.greco_at_dot.state.mn.us>
Date: Fri, 05 Sep 2003 13:12:22 -0500
Message-ID: <qsjhlv4jq23d1pptt0jbiti3sd10qtcpoc_at_4ax.com>


shija03_at_hotmail.com (Jim) wrote:

>I have a file that contains several records where each field is
>delimited by commas:
>
> 'field1','field2','field3','field4',
>
>ie:
> 'aaa','b','c','d',
> 'aaaaaaaa',bbb','','ffff',
>
>I would like to use sqlldr to load the file into a table placing each
>record's field in the following fashion:
>
>LOAD DATA
>APPEND
>INTO TABLE mytable
>FIELDS TERMINATED BY ","
>TRAILING NULLCOLS
>(
> column1 field1
> column2 field2
> column3 field3
> column4 field2
> column5 field2
> column6 field3
>)
>
>Thank you
You can try ( but I do not think you really want to do this) :

LOAD DATA
APPEND
INTO TABLE mytable
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
(

     field1,
    field2,
    field3,
   field2,
   field2,
    field3, etc
)
Basically you name the field into which each value in each row of the delimited file should go . Now, as to why not to do this:
Each subsequent reference to field2 after the first one , for instance, will replace the data previously loaded with the new value as long as the same row of input data is being read and this method may not even work - I've never tried it..

If what you really want to do is to split a single line of input data into more than one record, that requires a different approach and may not be possible.. Received on Fri Sep 05 2003 - 20:12:22 CEST

Original text of this message