Unix Technical Forum

Eliminate Duplicates Using SQLLDR and/or .ctl file

This is a discussion on Eliminate Duplicates Using SQLLDR and/or .ctl file within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Is there anyway of eliminating duplicate entries as the database loads data using SQLLDR and/or .ctl (Control File)? I ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-07-2008, 08:56 AM
gilgantic
 
Posts: n/a
Default Eliminate Duplicates Using SQLLDR and/or .ctl file

Is there anyway of eliminating duplicate entries as the database loads data
using SQLLDR and/or .ctl (Control File)?

I use the following command line using SQLLDR and a control file to load my
data, but the sample.dat file has duplicate information. I would like to be
able to eliminate this, since I have know ability to manipulate the sample.dat.
${ORACLE_HOME}/bin/sqlldr $USERPW /home/sample/sample.ctl

############# sample.ctl ###############
OPTIONS (DIRECT=TRUE)
LOAD DATA
INFILE '/home/sample/sample.dat'
truncate
INTO TABLE SAMPLE
(
NAME position(01:32) char,
EMAIL position(33:65) char
)
########################################

Thank You
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-07-2008, 08:56 AM
tojo
 
Posts: n/a
Default Re: Eliminate Duplicates Using SQLLDR and/or .ctl file

In article <d6052717.0307150509.33ee2a31@posting.google.com >,
gilgantic@yahoo.com says...
> Is there anyway of eliminating duplicate entries as the database loads data
> using SQLLDR and/or .ctl (Control File)?
>
> I use the following command line using SQLLDR and a control file to load my
> data, but the sample.dat file has duplicate information. I would like to be
> able to eliminate this, since I have know ability to manipulate the sample.dat.
> ${ORACLE_HOME}/bin/sqlldr $USERPW /home/sample/sample.ctl
>
> ############# sample.ctl ###############
> OPTIONS (DIRECT=TRUE)
> LOAD DATA
> INFILE '/home/sample/sample.dat'
> truncate
> INTO TABLE SAMPLE
> (
> NAME position(01:32) char,
> EMAIL position(33:65) char
> )
> ########################################
>
> Thank You
>

Can you manipulate the SAMPLE table? I would create a unique constraint
on the field(s) you don't want duplicated. The duped records from the
sample.dat would then land in your badfile.

-- Tom
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:08 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com