This sql code works in the two cases but AFAIK ;-) it shouldn't in the second
Am I right? CREATE TABLE staff_01( id INTEGER PRIMARY KEY AUTOINCREMENT, id_staff_editor INTEGER NOT NULL, code CHAR(2) NOT NULL, FOREIGN KEY(id_staff_editor) REFERENCES staff_01(id) ); INSERT INTO staff_01(id_staff_editor,code) VALUES(1,'CB'); PRAGMA foreign_keys = ON; CREATE TABLE staff_02( id INTEGER PRIMARY KEY AUTOINCREMENT, id_staff_editor INTEGER NOT NULL, code CHAR(2) NOT NULL, UNIQUE(code) FOREIGN KEY(id_staff_editor) REFERENCES staff_02(id) ); INSERT INTO staff_02(id_staff_editor,code) VALUES(1,'CB'); _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users