I work with Oracle 11g.
I have one table:
create table test (one number(2), two number(2));
There are 2 rows:
insert into test (one, two) values (1, 1);
insert into test (one, two) values (2, null);
commit;
Now I create an exceptions table:
create table exceptions(row_id rowid,
owner varchar2(30),
table_name varchar2(30),
constraint varchar2(30));
Now I want to create the primary key for test:
alter table test add constraint test_pk primary key (one, two) exceptions into exceptions;
Of course I get the following error: ORA-01449
But the row that caused the exception is not in the exception table?
Can anybody help me. Thanks in advance
Wolfgang
In order to do this, you must first create the constraint disabled:
Then, enable the constraint with exceptions:
Then you can select the results: