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

From: george lewycky <gelewyc_at_nyct.com>
Date: 30 Oct 2002 13:28:16 -0800
Message-ID: <68aecc05.0210301328.4e48d8ae_at_posting.google.com>


I dont think sql*loader will let you share a column with another field like you need it.

O'Reilly has a fantastic book out on SQL*Loader that helped me a great deal.

I would use SQL after your sqlloader finishes and just set the field to your constant value if you cant enter another column in your .csv file

ex.

update FTDISIntProcessPlan

                set thefield='10';

good luck

george

rajah_james_at_yahoo.com (Rajah James) wrote in message news:<86114a1a.0210291424.5e118499_at_posting.google.com>...
> 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 Wed Oct 30 2002 - 22:28:16 CET

Original text of this message