Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Oracle does not rollback correctly after ENABLE CONSTRAINT failed
Hi,
I run into a very weird behavier of Oracle server.
After a failed attempt to enable foreign key the rollback did not
return to the original database state.
Example:
I have two tables, in one (EMPL) there is a foreign key to the outher
(DEPT).
I have disabled the constraint and then delete all the rows in the
DEPT table.
Then I tried to enable the foreign key constraint and it failed (as it
should), but when attempt to rollback it did not return to the
original state.
Here is a smal SQL script that ilustrate the problem:
drop table empl;
drop table dept;
CREATE table dept(id integer not null, name varchar(25) not null);
CREATE table empl(id integer not null, name varchar(25) not
null,dept_id integer not null);
ALTER TABLE dept ADD CONSTRAINT dept_pk PRIMARY KEY (id); ALTER TABLE empl ADD CONSTRAINT empl_pk PRIMARY KEY (id); ALTER TABLE empl ADD CONSTRAINT empl_dept_fk FOREIGN KEY(dept_id)REFERENCES dept;
Well friends, Any ideas
Uri
Received on Mon Feb 05 2007 - 09:52:20 CST
![]() |
![]() |