?
Solved

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

Posted on 2008-10-08
4
Medium Priority
?
392 Views
Last Modified: 2013-12-18
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?
0
Comment
Question by:GIFT22075
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Shaju Kumbalath earned 2000 total points
ID: 22668945
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
 
LVL 15

Expert Comment

by:Shaju Kumbalath
ID: 22668953
where seq_no is auto incremented
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 22669319
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
 

Author Comment

by:GIFT22075
ID: 22669368
thanks you guys i'm testing out the solutions now and will post feedback
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question