Solved

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

Posted on 2008-10-08
4
362 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
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Shaju Kumbalath earned 500 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 73

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql query 5 68
How to connect SQL Server from my Oracle database? 11 70
join 2 views with 5 conditions 3 44
Distinct values from all columns in a table?? PL SQL 4 20
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
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…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

912 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now