Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Loader and multiple tables
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 thedata into the first table
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.
--