I'm receiving data in Excel, which is easy enough to save as CSV for SQLLDR. (Score!)
The spreadsheet is w-i-i-i-de: several tables are laid out side-by-side. I'm trying to use SQLLDR to get the data into several tables. An extract of my code looks like this:
A substring of Excel's Column D is going to be the primary key in each table. For the first table, Batch1, SQLLDR lets me create the C_Key field on-the-fly from field C_ID. But when I subsequently try to refer to :C_ID again, it gives me an error: SQL*Loader-291: Invalid bind variable :C_ID in SQL string for column C_KEY.
How can I grab the C_ID value for the second (and following) tables?
The spreadsheet is w-i-i-i-de: several tables are laid out side-by-side. I'm trying to use SQLLDR to get the data into several tables. An extract of my code looks like this:
Code:
LOAD DATA
APPEND
INTO TABLE BATCH1 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(
C_CON CHAR,
C_DATE "TO_DATE(:C_DATE,'DD-MON-YYYY')",
C_WIT CHAR,
C_ID CHAR,
C_KEY "SUBSTR(:C_ID,1,8)"
)
INTO TABLE BATCH2 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(
C_TYPE CHAR,
C_NUM CHAR,
C_PREVDT "TO_DATE(:C_PREVDT,'DD-MON-YYYY')",
C_KEY "SUBSTR(:C_ID,1,8)"
)
A substring of Excel's Column D is going to be the primary key in each table. For the first table, Batch1, SQLLDR lets me create the C_Key field on-the-fly from field C_ID. But when I subsequently try to refer to :C_ID again, it gives me an error: SQL*Loader-291: Invalid bind variable :C_ID in SQL string for column C_KEY.
How can I grab the C_ID value for the second (and following) tables?