Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8547783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:20:32+00:00 2026-06-11T13:20:32+00:00

I was wondering what would be the preferred technique in Oracle to copy multiple

  • 0

I was wondering what would be the preferred technique in Oracle to copy multiple records into a database that ignored duplicate values on a certain index. the statements are stated explicitly in the statement and don’t come from another table

INSERT INTO EXAMPLE (A, B, C, D) VALUES (null,'example1','example2',EXAMPLE_SEQ.nextval);
INSERT INTO EXAMPLE (A, B, C, D) VALUES (null,'example2','example3',EXAMPLE_SEQ.nextval);
INSERT INTO EXAMPLE (A, B, C, D) VALUES (null,'example4','example5',EXAMPLE_SEQ.nextval);

I am currently doing it like this and checking manually, but need to find a way so that these can be handled as scripts

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:20:34+00:00Added an answer on June 11, 2026 at 1:20 pm

    If you’ve decided to stick with INSERTs you can prevent insertion of duplicate rows by using constraints whether it primary key or unique key. If it happens to violate a unique constraint your script will stop and you’ll have to roollback all changes made by previous inserts(unless you have committed every single of them). To handle that exception you could write a similar pls/sql block.

    declare
      l_unique_exception exception;
      pragma exception_init(l_unique_exception, -1);
    begin
      insert into test(id, test_vector)
        values(1, 123);
      insert into test(id, test_vector)
       values(1, 123);
      ......
      Insert into 
      commit;
    exception
      when l_unique_exception
        then process the exception;    
    end;  
    

    IN ADDITION

    If you want to proceed after one of the inserts raises an exception then the following example might be in handy.

    1. Create a table that going to contain errors. For example.

      CREATE TABLE tb_errors (
      ErrorTag varchar2(123)
      )

    2. Provide an error logging invoking CREATE_ERROR_LOG procedure of DBMS_ERRLOG package

      DBMS_ERRLOG.CREATE_ERROR_LOG('YourDmlTable. Test in this case', 'tb_errors');

    3. Add log errors into clause to each insert

    Here is an example

    declare
    begin
      insert into test(id, col1)
         values(1, 123)
         log errors into tb_errors('simple expression') reject limit unlimited;   
      insert into test(id, col1)
         values(1, 123)
         log errors into tb_errors('simple expression') reject limit unlimited;   
      insert into test(id, col1)
         values(1, 123) 
         log errors into tb_errors('simple expression') reject limit unlimited;
      commit;
    end;
    

    After your script is completed you can query error logging table, tb_errors in this case, to see what went wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I am wondering what would cause it so that all events for the
I am wondering what would be the best/preferred way to write a scanning app
I was just wondering that why would the driver manager class provides many overloaded
I was wondering would I still need to use a basic game loop for
I'm wondering what would be best to do. Right now I have running a
I am wondering how would you store a list of categories and sub categories
I am wondering what would happen if I tried to read files in Java
Hey im just wondering what would be the best collection to use when creating
i was wondering what would be the best way to code a browser plugin
I was just wondering which would be cheaper, using a try catch block for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.