cascading delete does not work
Posted in 2000
Topics: General Discussion
Here is a simple example that I have not been able to get to work
create table tab1 (k int primary key);
create table tab2 (k int references tab1(k) on cascade delete, v int);
insert into tab1 values(1);
insert into tab2 values(1,2);
delete from tab1 where k = 1;
generates the following error
692: Key value for constraint (uncros.u117_57) is still beingreferenced.
Hello,
Probably, You have created your database without logging.
Informix does not support cascade deletes if logging is turned off.
Ilia
Swapan Engineer <swapan@erols.com> writes:
> Here is a simple example that I have not been able to get to work
>
> create table tab1 (k int primary key);
> create table tab2 (k int references tab1(k) on cascade delete, v int);
create table tab2 (k int references tab1(k) on delete cascade, v int);
>
> insert into tab1 values(1);
> insert into tab2 values(1,2);>
> delete from tab1 where k = 1;>
> generates the following error
>
> 692: Key value for constraint (uncros.u117_57) is still being> referenced.