Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email firstname.lastname@example.org
Again: Problem with "ON DELETE SET NULL"
From: Ralf Schneider (mltapfere-schneiderleins.de)
Date: Tue Jan 10 2006 - 15:14:40 CST
I did not get a real answer to my question two weeks ago, so I try it again:
I try to create a table with two foreign key definitions like the following
statement on a MaxDB 18.104.22.168:
create table USERS
ID integer not null,
USERNAME varchar(100) not null,
primary key (ID),
FOREIGN KEY FK_USER_REFE_USER1 (CREATED_BY) REFERENCES USERS (ID) ON
FOREIGN KEY FK_USER_REFE_USER2 (MODIFIED_BY) REFERENCES USERS (ID) ON
This statement fails with an error:
SQL error -7040 = Referential constraint not allowed (error position: 1)
When I remove one of the foreign key definitions (doesn't matter which one)
the statment works fine. When I replace the "ON DELETE SET NULL" by "ON
DELETE CASCADE" also executes without error.
Why can't I define these two foreign keys? I did not find any restrictions in
the docs describing this behavior.
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb