Re: sql loader
Date: Mon, 24 Jun 2002 20:16:04 GMT
Message-ID: <3D177CE7.F0143C2C_at_shaw.ca>
how about setting up a row level AFTER INSERT trigger on your Client table?
hajar wrote:
>
> What I'm trying to do is to load the same line of data (with all its
> fields) to 2 different tables: Client and then Contrat.
> I generate a sequence number each time I load data into Client and I
> want to use this sequence number to load into Contrat before going to
> the next line of data.
> Here is the code I use each in a separate file, but it doesn't work
> because of the sequence number:
>
> LOAD DATA
> INFILE *
> APPEND
> into table Client FIELDS TERMINATED BY ","
> TRAILING NULLCOLS
> (
> field1 FILLER,
> field2 FILLER,
> numero_GSM,
> nom_client,
> field3 FILLER,
> field4 FILLER,
> field5 FILLER,
> field6 FILLER,
> field7 FILLER,
> field8 FILLER,
> client_id "(client_sequence.nextval)"
> )
> BEGINDATA
> 145687,142568479,061703485,Siham,154.50,1684.25,2.5,1,25/05/2002,25/06/2002
> B145865,14.25.88.479,064168022,hajar,1544.50,1654.40,1.2,1,10/02/2002,22/04/2002
> C124665,22.42.84.366,067941312,ilham,144.00,1523.50,1.2,1,06/04/2002,04/06/2002
>
> LOAD DATA
> INFILE *
> APPEND
> into table Contrat FIELDS TERMINATED BY ","
> TRAILING NULLCOLS
> (
> contrat_id,
> compte_id,
> field1 FILLER,
> field2 FILLER,
> field3 FILLER,
> field4 FILLER,
> field5 FILLER,
> etat,
> date_souscription ,
> date_d_modification,
> client_id "(select client_id from Client where nom_client LIKE
> field2)"
> )
> BEGINDATA
> 145687,142568479,061703485,Siham,154.50,1684.25,2.5,1,25/05/2002,25/06/2002
> B145865,14.25.88.479,064168022,hajar,1544.50,1654.40,1.2,1,10/02/2002,22/04/2002
> C124665,22.42.84.366,067941312,ilham,144.00,1523.50,1.2,1,06/04/2002,04/06/2002
Received on Mon Jun 24 2002 - 22:16:04 CEST
