The following message is a courtesy copy of an article that has been posted to comp.lang.java.databases as well.
You are more likely to get answers to your questions if you subscribe to [EMAIL PROTECTED] You can find more info about Derby and Derby mailing lists here http://db.apache.org/derby/derby_comm.html >>>>> "B" == Bloggs <[EMAIL PROTECTED]> writes: B> Hi All, B> I have created the following tables: B> ------------------------------------------------------------------------------------------------------------------ B> DROP TABLE FREQUENCYTABLE; B> DROP TABLE FOODNAMETABLE; B> CREATE TABLE FOODNAMETABLE (ID SMALLINT GENERATED ALWAYS AS IDENTITY, B> FOOD VARCHAR(40) NOT NULL PRIMARY KEY, B> FOLDER VARCHAR(40) NOT NULL, B> FOREIGN KEY (FOLDER) REFERENCES B> FOLDERNAMETABLE(FOLDER)); B> CREATE TABLE FREQUENCYTABLE (FREQUENCY VARCHAR(40) NOT NULL, B> FOOD VARCHAR(40) NOT NULL, B> AMOUNT SMALLINT NOT NULL DEFAULT 0, B> INCLUDE SMALLINT NOT NULL DEFAULT 0 CHECK B> (INCLUDE BETWEEN 0 AND 1), B> FOREIGN KEY (FOOD) REFERENCES B> FOODNAMETABLE(FOOD) ON DELETE CASCADE); B> ------------------------------------------------------------------------------------------------------------------ B> If I attempt to to update the NAME column in the FOODNAMETABLE I can't B> because of Derby's referential integrity rules, also I can't use B> cascading updates because Derby does not appear to have them although B> it has cascading deletes. B> If I write a trigger to perform a cascading update can I use it without B> first redefining the tables or do I need to remove the constraints I B> have already defined on these columns before my trigger will work. B> Thanks in advance, B> Regards, B> MrFred. -- dt However, experience shows that for many people and many applications a dose of paranoia is reasonable - Bjarne Stroustrup
