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 and multiple tables

Re: SQL Loader and multiple tables

From: gremlin <gremlinNO__SPAM___at_ix.netcom.com>
Date: Sun, 28 Mar 1999 01:44:19 -0500
Message-ID: <36FDCFC3.41AABFA8@ix.netcom.com>


I would try a Perl script of some kind to

1) Read the first line
2) Generate the sequence value
3) Make a quick little sqlldr ctl and dat file and get sqlldr to enter the
data into the first table
4) Have the Perl script read in each line of the second file and replace some dummy field with the sequence value
5) Write out the line to a new slldr dat file
6) Make the second ctl file
7) call sqlldr for that file.

This won't work really if you have lots of data and little disk space though. Can it be done with triggers on the first table?

Good luck,

    Mike

Michael Rothwell wrote:

> RDBMS: 7.3.4
>
> I am using SQL*Loader to load two tables from a single file and want to do
> the following:
>
> The first record in the file is a header record - I will asign a
> SEQUENCE(MAX,1) value to a LOAD_ID field in table_a_header.
>
> The remaining records will be loaded into table_a which also has a LOAD_ID
> field.
>
> I want to use the LOAD_ID generated by the SEQUENCE for table_a_header for
> all the records that will be loaded into table_a.
>
> I need to be able to have a relationship between the two tables, if anyone
> has any suggestions, I would appreciate it.
>
> Thanks.
>
> --
> Michael A. Rothwell
> Oracle DBA/Oracle Web Applications Developer
>
> Views expressed here are not those of my company
> No - Actually - Since I am independent, They are the views of my company.

--



To reply to me via email, remove the "__NO_SPAM__" in the header email address.
Received on Sun Mar 28 1999 - 00:44:19 CST

Original text of this message

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