Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Eliminate Duplicates Using SQLLDR and/or .ctl file
"gilgantic" <gilgantic_at_yahoo.com> wrote in message
news:d6052717.0307150509.33ee2a31_at_posting.google.com...
> 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
You're not able to manipulate the dat file, but perhaps you can pipe the
file through a utility that removes duplicates (sort,uniq). SQL*Loader does
not support piping data directly, but you can use a named pipe for that
(mknod, mkfifo):
mkfifo -m 600 temp.dat
sort -u sample.dat > temp.dat &
sqlldr data=temp.dat ...
rm temp.dat
Received on Tue Jul 15 2003 - 15:20:40 CDT
![]() |
![]() |