Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: pl/sql dup_val_on_index
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 DBAReceived on Tue Dec 06 2005 - 06:19:20 CST
![]() |
![]() |