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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:00:13+00:00 2026-05-10T20:00:13+00:00

I am using: set constraints all deferred; (lots of deletes and inserts) commit; This

  • 0

I am using:

set constraints all deferred; (lots of deletes and inserts) commit; 

This works as expected. If there are any broken relationships then the commit fails and an error is raised listing ONE of the FKs that it fails on.

The user fixes the offending data and runs again. then hits another FK issue and repeats the process.

What I really want is a list of ALL FKs in one go that would cause the commit to fail.

I can of course write something to check every FK relationship through a select statement (one select per FK), but the beauty of using the deferred session is that this is all handled for me.

  • 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. 2026-05-10T20:00:14+00:00Added an answer on May 10, 2026 at 8:00 pm

    First option, you can look into DML error logging. That way you leave your constraints active, then do the inserts, with the erroring rows going into error tables. You can find them there, fix them, re-insert the rows and delete them from the error table.

    The second option is, rather than trying the commit, attempt to re-enable each deferred constraint dynamically, catching the errors. You’d be looking at a PL/SQL procedure that queries ALL_CONSTRAINTS for the deferrable ones, then does an EXECUTE IMMEDIATE to make that constraint immediate. That last bit would be in a block with an exception handler so you can catch the ones that fail, but continue on.

    Personally, I’d go for option (1) as you do get the individual records that fail, plus you don’t have to worry about deferrable constraints and remembering to make them immediate again after this script so it doesn’t break something later.

    I guess somewhere in memory Oracle must be maintaining a list, at least of constraints that failed if not the actual rows. I’m pretty confident it doesn’t rescan the whole set of tables at commit time to check all the constraints.

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

Sidebar

Ask A Question

Stats

  • Questions 67k
  • Answers 67k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I would do a mass update to the database tables… May 11, 2026 at 12:00 pm
  • added an answer It may be best to replace the characters separately, as… May 11, 2026 at 12:00 pm
  • added an answer I normally use a ServletHolder, like this: WebAppContext context =… May 11, 2026 at 12:00 pm

Related Questions

I am using: set constraints all deferred; (lots of deletes and inserts) commit; This
I am using a set because, i want to use the quick look up
I am using SetCursor to set the system cursor to my own image. The
I am using winsock and C++ to set up a server application. The problem
I am using the following code to set a tray icon in Windows and
I am using the following method: set_browser_log_level 'off' but my log level continues to
I am using a DBGrid component in Delphi. I wonder how I can set
I am using the Html.TextBox helper to create textboxes. I want to set attributes
I am using a RichTextBox in WPF, and am trying to set the default
NOTE: I am not set on using VI, it is just the first thing

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.