SQLLDR: Mapping 1value in .dat file to 2 Columns in Table - LONG

From: Rajah James <rajah_james_at_yahoo.com>
Date: 29 Oct 2002 14:24:01 -0800
Message-ID: <86114a1a.0210291424.5e118499_at_posting.google.com>



[Quoted] I have a a CSV file that I will be loading using sqlldr. I want one of the values from the CSV file to be loaded into two columns in the same table.

One of the two columns already gets loaded, SOperationUniqueIdentifier. The other is called sOperationNumber, and occurs in the table immediately following the column SOperationUniqueIdentifier. The value I want is always going to be the second value in the CSV file, as in '10' in the first sample record below. How could modify my control file to accomplish this?

Here is my control file currently:

----ProcessPlan.ctl----

Options(SKIP=1)

load data
infile 'ProcessPlan.csv'

replace

into table FTDISIntProcessPlan

Fields TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(

	SProcessPlanName CHAR,
	SOperationUniqueIdentifier CHAR,
	sOperationName CHAR,
	dSetupTime DECIMAL EXTERNAL,
	sSetupPhaseName CHAR,
	dProcessTime DECIMAL External,
	bProcessBatchTimeFlag INTEGER EXTERNAL,
	sProcessPhaseName CHAR,
	dTeardownTime DECIMAL EXTERNAL,
	sTeardownPhaseName CHAR,
	sWorkCellName CHAR,
	sAddResourceSetOneName CHAR,
	sAddResourceOneName CHAR,
	dAddResourceOneMinQuantity INTEGER EXTERNAL,
	sAddResourceOnePhaseType CHAR,
	sAddResourceSetTwoName CHAR,
	sAddResourceTwoName CHAR,
	dAddResourceTwoMinQuantity INTEGER EXTERNAL,
	sAddResourceTwoPhaseType CHAR,
	dEndOffset DECIMAL EXTERNAL

)
----End ProcessPlan.ctl----

Here is a few lines out of my CSV file:

----Begin ProcessPlan.csv----

SHP Red Bicycle Plan,10,Assemble and Pack SHP Red,0.43,,0.37,0,,0,,Assembly and Pack,,Labor,2,All,,,,, SHP Blue Bicycle Plan,10,Assemble and Pack SHP

Blue,0.43,,0.37,0,,0,,Assembly and Pack,,Labor,2,All,,,,,
SSD Red Bicycle Plan,10,Assemble and Pack SSD
Red,0.43,,0.37,0,,0,,Assembly and Pack,,Labor,2,All,,,,,

----End ProcessPlan.csv----

Thanks. Received on Tue Oct 29 2002 - 23:24:01 CET

Original text of this message