EffiProz 1.6 beta allows you to manually control if a cascaded delete of a row that is being cascaded update by the same operation generate an error (default behavior).
Use SET DATABASE SQL TDC DELETE statement to control this behavior as show in the following example,
Use SET DATABASE SQL TDC DELETE statement to control this behavior as show in the following example,
create table Tbl1(col1 int primary key, col2 int); insert into Tbl1 values(1,100); insert into Tbl1 values(2,200); create table Tbl2(col1 int foreign key references Tbl1(col1) on delete cascade, col2 int unique); insert into Tbl2 values(1,300); insert into Tbl2 values(2,400); create table Tbl3(col1 int primary key foreign key references Tbl1(col1) on delete cascade, col2 int foreign key references Tbl2(col2) on delete SET NULL, col3 varchar(100) ); insert into Tbl3 values(1,300,'car'); insert into Tbl3 values(2,400,'bus'); /*ERROR*/delete from Tbl1 where col1=1; SET DATABASE SQL TDC DELETE FALSE; delete from Tbl1 where col1=1; SET DATABASE SQL TDC DELETE TRUE; /*ERROR*/delete from Tbl1 where col1=2;
0 comments:
Post a Comment