Re: SQL Loader variable length comma delimited file

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Fri, 10 May 2002 17:44:14 GMT
Message-ID: <3CDC06E2.7D8C5A8F_at_exesolutions.com>


Tom wrote:

> Hi ,
> I was wondering if anyone could tell me how to specify the position
> when inserting variable length comma delimited records into multiple
> tables. The Oracle documentation does not seem to cover this.
> Because the positions of fields are relative if inserting into just
> one table you would just do somthing like:
>
> LOAD DATA
> INFILE'data04/ORACLE/TEST/prod'
> BADFILE'prod.bad'
> INSERT INTO TABLE pord'
> FIELDS TERMINATED BY','OPTIONALLY ENCLOSED BY ""
> trailing nullcols
> (
>
> PROD_CODE,
> PROD_DESCR,
> PROD_CLASS,
> PROD MKTG_CODE
> terminated by whitespace)
>
> All the examples for Multiple tables seem to use a start and end
> position as if it assumes that the records are fixed length e.g.
>
> dept no POISITION (1:2) integer external
>
> So what is to be done when the fields are of variable lenght, comma
> delimited and are to be inserted into multiple tables. I think i
> cannot use relative positioning as their position in the file is not
> the same as i would like to insert them into the tables (also there
> are fields in the file which i do not wish to insert at all). I cannot
> use start and end positions because the record is variable length??
> Any suggestions appreciated...

In delimited records position is irrelevant and not specified. That is the point of the delimiter.

Daniel Morgan Received on Fri May 10 2002 - 19:44:14 CEST

Original text of this message