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 -> Re: Sql*loader Problem

Re: Sql*loader Problem

From: Jurij Modic <jmodic_at_src.si>
Date: 1999/09/03
Message-ID: <37d72a12.6086580@news.siol.net>#1/1

On Fri, 03 Sep 1999 15:14:56 GMT, brettschneider_at_my-deja.com wrote:

>I have a problem that I haven't seen addressed in
>the sql*loader manual. I will be loading in a
>bunch of records from an Ascii file. The header
>record contains a field that has to be loaded
>with all the other records as a constant. Is
>there anyway to pick up that field and load it
>with the rest of the records.
>
>e.g.
>chicken,dog,cat
>aa,1234,3333
>bb,4321,4444
>cc,7645,1111
>
>Table should look like:
>dog,aa,1234,3333
>dog,bb,4321,4444
>dog,cc,7645,1111
>
>Thanks for any help.

You can create a dummy table with the same structure as the header record.

Attach the trigger to your destination table that will populate your "constant" column with the appropriate column from the dummy table record for each inserted row.

In your controlfile specify the first record to be loaded into your dummy table (perhaps with the REPLACE option) and all other records to be loaded into your destination table. The trigger will take care of the constant in each record.

You will not be able to use DIRECT PATH option with this method, though.

HTH,
Jurij Modic <jmodic_at_src.si>
Certified Oracle DBA (7.3 & 8.0 OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Fri Sep 03 1999 - 00:00:00 CDT

Original text of this message

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