Re: SQL Loader Master/Detail

From: Joep Hendrix <joep.hendrix_at_wxs.nl>
Date: Tue, 09 Jun 1998 21:06:31 +0200
Message-ID: <357D87B7.337E_at_wxs.nl>


Jim wrote:
>
> I asked this question before and have found a few answers. Thanks for all
> your help!
>
> I have a file which looks something like this
>
> HEADER LINE
> HEADER LINE
> HEADER LINE
>
> MASTER LINE 1
> MASTER LINE 2
> MASTER LINE 3
> MASTER LINE 4
>
> (always 4 lines for the Master)
>
> Detail lines 1 to possibly 15
>
> I can populate the Master table with the first row and the Detail with all
> of the rows.
> The Master/Detail relationship is set up using 2 sequences defined in
> the database. For the Master Table set the Master_ID_Sequence to NEXTVAL
> during the load.
>
> For the Detail table, use NEXTVAL for the Detail_ID_sequence and use
> CURRVAL for
> the Master_ID_FK fieldduring the load. Set the commit option for ROWS to 1.
> This will give the Master/detail relationship between
> the tables.
>
> The only thing I can't figure out is how to load 4 rows into the Master
> table
> and only 1 in the Detail. I tried CONCATENATE 4, but that takes every 4
> lines
> together as one. I also tried CONTINUEIF.
>
> BTW: Does anybody think that SQL*Loader is really WEAK as an Oracle
> product?
>
> THANKS!
I think the easiest wat is to load everything into one temporary table and then use pl/sql to insert into a existing master-detail. In this way you have much more control, error handling and debugging.

Joep

-- 
LET OP!!!!
Nieuw email adres:

Zwolle, The Netherlands
Joep Hendrix
e-mail:		joep.hendrix_at_wxs.nl
NEW homepage:	http://home.pi.net/~jhendrix/index.html
Received on Tue Jun 09 1998 - 21:06:31 CEST

Original text of this message