Of course I could write a trigger and check each column individually, but I like to prefer constraints rather than triggers, they are easier to maintain and don't require manually written code.

Any idea?

There no straightforward way to report all possible constraint violations. Because when Oracle stumble on first violation of a constraint, no further evaluation is possible, statement fails, unless that constraint is deferred one or the log errors clause has been included in the DML statement. But it should be noted that log errors clause won't be able to catch all possible constraint violations, just records first one.

As one of the possible ways is to:

create exceptions table. It can be done by executing ora_home/rdbms/admin/utlexpt.sql script. The table's structure is pretty simple;

disable all table constraints;

execute DMLs;

enable all constraints with exceptions into <<exception table name>> clause. If you executed utlexpt.sql script, the name of the table exceptions are going to be stored would be exceptions.

Test table:

create table t1(
col1 number not null,
col2 number not null,
col3 number not null,
col4 number not null
);

The above query gives us column names, and rowids of problematic records. Having rowids at hand, there should be no problem to find those records that cause constraint violation, fix them, and re-enable constraints once again.

Here is the script that has been used to generate alter table statements for enabling and disabling constraints:

Related Articles

I developing one asp.net application in that I using htmlagility dll to get all <div> tags which is same class attributes.. How to get all elements who have same class from whole html page, I getting top 1 div who having class='myclass' but in, my c

I have a User and Post scaffolded in my rails application. I wanted to get all of the posts associated with a user. For example, I want to be able to do something like this: localhost:3000/users/1/posts And it should give me all of the posts with the

In Rails i18n, how to get all values for a certain key using the following: translations = I18n.backend.send(:translations) get all the keys I need to be able to get a certain section for example only return everything under "home" en: home: tes

I am new to android. Now i am need to know how to get text values of all edittext which has added dynamically when user press add button. add.setOnClickListener(new OnClickListener() { public void onClick(View v) { table = (TableLayout) findViewById(

I have a jar file in which some Spring beans are defined. My question is given the InputStream object of this jar file, how to get all Spring bean names from it? Or is there any Spring official api with the InputStream as parameter to get the instanc

How to get all ContentTypes from a Site Collection in a SharePoint Farm. Remember, I want to do this using the SharePoint Object Model. Any help will be appreciated.It can be done like this: public void ListContentTypes(string siteUrl) { try { using

I have a linked list. I want to set a weight factor p^i for each position i of this list. Then I want to get a weighted value for the elements of the list as the sum of these factors. Let me give an example to make things concrete. Let us say that my

This is the result of separating a single table in two: Table users: user_id (pk, ai) email password last_login Table data: user_id (fk to users.user_id) data_1 data_2 To select a single record when there was only one table: SELECT users.email, users

I wants to get all the row's records, even it has 2 or 3 columns. I want to get all the values from tbody. I tried this code. But it doesn't work Here is code $("#btnSearch").click(function() { $("table > tbody > tr").each(functi

I already get all contact number (name,number ) in array and display in listview.. i already know way to insert single value into database using volley but i dont know how to insert array. cursor1 = getContentResolver().query(ContactsContract.CommonD