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 -> Re: SQL*Loader: How to populate foreign keys?

Re: SQL*Loader: How to populate foreign keys?

From: Madhu Cherukuri <Madhu.Cherukuri_at_worldnet.att.net>
Date: 1998/08/19
Message-ID: <6rd96o$qqq@bgtnsc01.worldnet.att.net>#1/1

Try using the sequence.CURRVAL
this will give you the same sequence number until you issue a select sequence.NEXTVAL statement This is valid in the same session

HTH Madhu Cherukuri

Todd Owers wrote in message <6rcupk$tm$1_at_nntp.gulfsouth.verio.net>...
>I want to use SQL*Loader to load multiple tables. My question is this: I
>am populating the primary key of Table A with a sequence. I need to
 capture
>that value in order to use it again, to populate a foreign key in Table B.
>
>I know the control file allows multiple INTO TABLE statements with WHEN
>clauses to direct the data to the appropriate table. But I need to re-use
>the sequence value, not data from the input datafile.
>
>Chapter 5 of the Oracle7 Server Utilities manual states: " ...the same
>sequence number can be used when inserting data into multiple tables. This
>is frequently useful behavior. Case 3 on page 4-8 illustrates this
>situation." But Case 3 on page 4-8 has only one INTO TABLE statement. It
>does not illustrate the re-use of a sequence number.
>
>Is there something simple I am overlooking? Any suggestions would be
>appreciated. Thanks in advance for your help.
>
>Todd Owers
>toddo_at_gcr1.com
>
>
>
Received on Wed Aug 19 1998 - 00:00:00 CDT

Original text of this message

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