Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*LOADER, using multiple intos for the same table

Re: SQL*LOADER, using multiple intos for the same table

From: Ed Prochak <>
Date: Mon, 01 Oct 2007 18:56:54 -0000
Message-ID: <>

On Oct 1, 9:22 am, wrote:
> On Sep 30, 12:50 pm, wrote:
> > > The problem is I have to insert these values. Basically it's like a
> > > sentence that continues to the next line. I send the first wave
> > > through then another row to insert different data in a few select
> > > columns in the next. It's possible to do this but the problem in my
> > > case is that the primary key is a sequence and eventually it runs into
> > > a constraint error. I was hoping there would be some technical way to
> > How does a sequence eventually run into a constraint error?
> I believe it's b/c it only insert x amount of rows at a time for each
> into table statement. I am loading 50000+ rows and the constraint
> error happens after 64 rows are inserted. So, it's as if it it is
> starting the sequence over in the next into table statement. This
> sequence is not an object it is a dynamic sequence generated at
> execution.

Please read David's remarks carefully and completely. Then if you still insist on splitting the rows this way, you'll need two steps.

  1. Load the data into a staging table.
  2. Then split the data into the destination table via a PL/SQL program.

Outside of that, I think the PK you propose will not really work. you really need two columns as the Primary key. The first column would be your sequence, then your second column would be oh, let's call it part#. Then the PL/SQL program can generate the two rows where the column A has the same value and column part# has values like 'a' and 'b'

It is a poor design and you will really be better off with two tables. I just gave you enough rope to hang yourself, so be careful!

(PS and don't blame me your design fails! you were warned.) Received on Mon Oct 01 2007 - 13:56:54 CDT

Original text of this message