How do I maintain an auto increment identity column with direct path loads?

Hi Experts,
I have a very large flat text file.  I will be loading this file into an oracle database using direct path loading with committs happening every 1,000,000 rows.  I would like to maintain an autoincrementing identity column for each row that is imported.  This is easy to do with conventional path loading with setting up a sequence and an trigger on inserts.  How can this be done with direct path loads?
GIFT22075Asked:
Who is Participating?
 
Shaju KumbalathConnect With a Mentor Deputy General Manager - ITCommented:
eg:

LOAD DATA
INFILE 'xyz.dat'
BADFILE 'xyz.bad'
LOG xyz.log
INSERT INTO TABLE empmast
(emp_no POSITION(1:6) INTEGER,
emp_name POSITION(7:31) CHAR,
seq_no SEQUENCE(MAX,1))

0
 
Shaju KumbalathDeputy General Manager - ITCommented:
where seq_no is auto incremented
0
 
sdstuberCommented:
or use RECNUM if you simply need a 1..N count

LOAD DATA
INFILE 'xyz.dat'
BADFILE 'xyz.bad'
LOG xyz.log
INSERT INTO TABLE empmast
(emp_no POSITION(1:6) INTEGER,
emp_name POSITION(7:31) CHAR,
seq_no recnum)



0
 
GIFT22075Author Commented:
thanks you guys i'm testing out the solutions now and will post feedback
0
All Courses

From novice to tech pro — start learning today.