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 8539773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:26:47+00:00 2026-06-11T11:26:47+00:00

I have script files with thousands of sql INSERT INTO lines. Some of these

  • 0

I have script files with thousands of sql INSERT INTO lines. Some of these lines will insert data that’s already in the database, so I want to catch these errors and just bypass it. Is there a way to catch errors thrown by a trigger and ignoring it?

ERROR at line 1:
ORA-20053: Username must be unique
ORA-06512: at "MY_TRIGGER", line 18
ORA-04088: error during execution of trigger 'MY_TRIGGER'
ORA-06512: at line 3

I could do this with unique constraints by catching a DUP_VAL_ON_INDEX and then doing NULL, but this does not work for the above trigger error.

  • 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-11T11:26:49+00:00Added an answer on June 11, 2026 at 11:26 am

    You can define your own exception and use that just like you would use one of the default exception handlers like dup_val_on_index.

    DECLARE
      l_unique_username_ex exception;
      pragma exception_init( l_unique_username_ex, -20053 );
    BEGIN
      <<your INSERT statement>>
    EXCEPTION
      WHEN l_unique_username_ex
      THEN
        NULL; -- Ignore the error
    END;
    

    In general, though, it would make more sense to modify your scripts so that they only try to insert rows that do not already exist rather than letting the trigger try to flag them and then ignoring the error.

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

Sidebar

Related Questions

I have some .sql files with thousands of INSERT statements in them and need
Right now I have a script that will get the last five files in
For some reason, we have a script that creates batch files to XCOPY our
I need to have script.sh , that would create files f1.txt and f2.txt with
I have following script that executes all the .reg files in the current directory.
I currently have a script that deletes old log files and then takes any
I have a script in python that needs to read iso-8859-1 files and also
I have a bash script that processes all of the files in a directory
I have several thousands of files, some of them contain HTTP request and some
I have a PHP script that imports CSV files and goes through tens of

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.