Hi!
I have some trouble defining delete rules for foreign keys (kernel
version 7.4.3 on WindowsXP SP1 and Debian Linux 2.4.18). Here is a
create script for some test tables to demonstrate the problem:
create table TEST_B (
B_ID fixed(19,0) not null,
primary key (B_ID)
)
//
create table TEST_C (
C_ID fixed(19,0) not null,
primary key (C_ID)
)
//
create table TEST_D (
D_ID fixed(19,0) not null,
primary key (D_ID)
)
//
create table TEST_A (
A_ID fixed(19,0) not null,
B_ID fixed(19,0) not null,
C_ID fixed(19,0),
D_ID fixed(19,0),
primary key (A_ID),
foreign key FK_A_B (B_ID) references TEST_B (B_ID) on delete restrict,
foreign key FK_A_C (C_ID) references TEST_C (C_ID) on delete set null,
foreign key FK_A_D (D_ID) references TEST_D (D_ID) on delete set null
)
SAPDB ignores the delete rule and sets "RESTRICT" for all foreign
keys. Even if I use a ALTER TABLE statement to change the delete rule
or drop the foreign keys and redefine it with an ALTER TABLE
statement.
If I redefine the foreign keys in a different order (e.g. C, D, B) the
delete rule for the first one is correct ("SET NULL"), but the second
one is wrong again. It is the same for "CASCADE" except "SET NULL".
What is wrong with it?
Regards,
Florian
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general