SQLLDR and Using a Sequence
799867Sep 23 2010 — edited Oct 28 2010I am trying to load a file into an oracle table, and I need to add a sequence number as the first field.
Currently the data file is a pipe delimited file and is formatted as:
|1|||N|DESC|001
The first field needs to be a sequence number.
Here is the control file:
load data infile 'datafile.dat' badfile 'badfile.txt' append into table TABLENAME fields terminated by '|' TRAILING NULLCOLS (COL1 "COL1SEQID.NEXTVAL",VAL1,VAL2,VAL3,VAL4,VAL5,VAL6,VAL7,VAL8)
Here is the log file:
SQL*Loader: Release 10.2.0.3.0 - Production on Thu Sep 23 11:10:47 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: controlfile.ctl
Data File: datafile.dat
Bad File: badfile.txt
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Continuation: none specified
Path used: Direct
Silent options: FEEDBACK
Table TABLENAME, loaded from every logical record.
Insert option in effect for this table: APPEND
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
COL1 FIRST * | CHARACTER
SQL string for column : "COL1SEQID.NEXTVAL"
VAL1 NEXT * | CHARACTER
VAL2 NEXT * | CHARACTER
VAL3 NEXT * | CHARACTER
VAL4 NEXT * | CHARACTER
VAL5 NEXT * | CHARACTER
VAL6 NEXT * | CHARACTER
VAL7 NEXT * | CHARACTER
VAL8 NEXT * | CHARACTER
Table TABLENAME:
50755 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Bind array size not used in direct path.
Column array rows : 5000
Stream buffer bytes: 256000
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 50755
Total logical records rejected: 0
Total logical records discarded: 0
Total stream buffers loaded by SQL*Loader main thread: 12
Total stream buffers loaded by SQL*Loader load thread: 0
Run began on Thu Sep 23 11:10:47 2010
Run ended on Thu Sep 23 11:10:52 2010
Elapsed time was: 00:00:05.02
CPU time was: 00:00:00.92
All of the data loads, except the COL1, which should be the seq# is NULL for every row.
Can someone please assist on what is wrong? I'm very recent to Oracle, so any help is greatly appreciated.