sqlldr question: re-arrange variable-length fields?

From: Shmooth <shmooth_at_yahoo.com>
Date: Mon, 27 Sep 1999 20:39:16 GMT
Message-ID: <37EFD4CF.FD5CA944_at_yahoo.com>



Hello,

New to Oracle and sqlldr.

I need to load a 10-field text file, 'pipe-delimited optionally enclosed by carats', into a temp table -> only my table layout doesn't match the text file layout exactly. It seems possible to rearrange the data coming in if one is using fixed-length fields, but how to do with variable-length fields?

I've tried using '<column_name> POSITION(3)' and such, but no luck. I'm afraid I'm doing something horribly dense! CTL file is below:

Thanks.

--Peter--

  • SCRIPT: TEST.CTL LOAD DATA INFILE 'infile.dat' BADFILE 'infile.bad' DISCARDFILE 'infile.dsc' REPLACE INTO TABLE TEMP_UNCONSOLIDATED_LOG FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '^' TRAILING NULLCOLS ( ID RECNUM, TEMP_TABLE_COL_NAME1 CONSTANT 1, TEMP_TABLE_COL_NAME2 RECNUM, TEMP_TABLE_COL_NAME3 POSITION(2), TEMP_TABLE_COL_NAME4 POSITION(4), TEMP_TABLE_COL_NAME5 POSITION(3), TEMP_TABLE_COL_NAME6 POSITION(5), TEMP_TABLE_COL_NAME7 POSITION(6), TEMP_TABLE_COL_NAME8 POSITION(1), TEMP_TABLE_COL_NAME9 sysdate, TEMP_TABLE_COL_NAME10 CONSTANT 1 )
Received on Mon Sep 27 1999 - 22:39:16 CEST

Original text of this message