Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: pl/sql dup_val_on_index

Re: pl/sql dup_val_on_index

From: <sybrandb_at_yahoo.com>
Date: 6 Dec 2005 04:19:20 -0800
Message-ID: <1133871560.128584.284450@g47g2000cwa.googlegroups.com>


insert into select where not exists
or
insert into select where not in

Don't *kludge* procedurally what you can do non-procedurally. (Or stick to flat files)

Also your 'solution' wouldn't help, as it would abort as soon as you get the first duplicate.
You would need to
for i in (select * from original_table ) loop begin
insert into .. values (i.c1, i.c2);
exception
when dup_val_on_index then null;
end;
end loop;
/

Needless to say you will end up with an unscalable app.

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Tue Dec 06 2005 - 06:19:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US