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 -> Sql loader

Sql loader

From: Marcel Raap <mz_at_kva.nl>
Date: Wed, 28 Oct 1998 14:35:26 GMT
Message-ID: <36372b6f.23558054@news2.cistron.nl>


I want to load an ASCII-file into two (master-detail) tables using SQL*Loader. Each line in the file contains one master-record and 0 or more detail-records.

The master-record does not have an unique field. I can create an unique value by using the sequence-command. The problem is: how can I copy this value into the foreign-key-files in the detail-table? I've tried to create a database sequence and use the nextval for the master-table and the currval for the detail-table. For no obvious reason this doesn't work right. Detail-records are attached to the wrong master-records and sometimes I get primary key-violation-errors.

Using RECNUM is not an option, cause I also want to be able to load more files sequentially (the 'append'-option in the control file).

Does anyone know a better solution???

Thanks in advance,

Marcel Raap

CIOB Kramers Woerden B.V.
The Netherlands Received on Wed Oct 28 1998 - 08:35:26 CST

Original text of this message

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