Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to ... dup_val_on_index

abladbJul 18 2016 — edited Jul 19 2016

Morning you all,

I wonder if I could know which record is the one that is causing the dup_val_on_index error. Let's say the following:

begin

  insert .... select * from table1;

exception

  when dup_val_on_index then

    dbms_output.put_line('ERROR '|| SQLCODE ||' --  '|| SQLERRM);

    -- Is there a way to write which ones are the duplicated records, having an insert select right here?

end;

Is there a way to DBMS_xxxxx.any_function to take out that?

Thanks in advance.

This post has been answered by John Stegeman on Jul 18 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 16 2016
Added on Jul 18 2016
19 comments
996 views