sql*loader - load same sequence in 2 columns
Date: Wed, 27 Sep 2000 08:40:18 GMT
Message-ID: <8qsbpi$ekm$1_at_nnrp1.deja.com>
Hello all
I am using sql*loader to load a csv file and I am generating a sequence to provide the value for one column and I want to load this value into another column as well. In the script below I want to set the value of A_COUNTRY_ID to the value generated by the sequence statement for A_REGION_ID. I know I could just run a sql statement afterwards to update the A_COUNTRY_ID column but I would like to do it all in one go within sql*loader.
LOAD DATA
INFILE '/home/testadm/countries.txt'
APPEND INTO TABLE voyager.gtregion
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
(A_AREA_STATUS CONSTANT 0,
A_AREA_ID CONSTANT 0, A_CITY_STATUS CONSTANT 0, A_CITY_ID CONSTANT 0, A_COUNTRY_STATUS CONSTANT 0, A_GEN_TAB_ID CONSTANT "Region", A_REG_CODE, A_REG_DESC, A_REG_LEVEL CONSTANT 1, A_REGION_STATUS CONSTANT 0, A_REGION_ID SEQUENCE(MAX, 1), A_COUNTRY_ID ??????????)
What should I do?
[Quoted] Many thanks in advance for your help.
Paul
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Sep 27 2000 - 10:40:18 CEST
