Cascading Updates In Derby Query?



Hi All,

I have created the following tables:

------------------------------------------------------------------------------------------------------------------
DROP TABLE FREQUENCYTABLE;
DROP TABLE FOODNAMETABLE;

CREATE TABLE FOODNAMETABLE (ID SMALLINT GENERATED ALWAYS AS IDENTITY,
FOOD VARCHAR(40) NOT NULL PRIMARY KEY,
FOLDER VARCHAR(40) NOT NULL,
FOREIGN KEY (FOLDER) REFERENCES
FOLDERNAMETABLE(FOLDER));

CREATE TABLE FREQUENCYTABLE (FREQUENCY VARCHAR(40) NOT NULL,
FOOD VARCHAR(40) NOT NULL,
AMOUNT SMALLINT NOT NULL DEFAULT 0,
INCLUDE SMALLINT NOT NULL DEFAULT 0 CHECK
(INCLUDE BETWEEN 0 AND 1),
FOREIGN KEY (FOOD) REFERENCES
FOODNAMETABLE(FOOD) ON DELETE CASCADE);
------------------------------------------------------------------------------------------------------------------

If I attempt to to update the NAME column in the FOODNAMETABLE I can't
because of Derby's referential integrity rules, also I can't use
cascading updates because Derby does not appear to have them although
it has cascading deletes.

If I write a trigger to perform a cascading update can I use it without
first redefining the tables or do I need to remove the constraints I
have already defined on these columns before my trigger will work.

Thanks in advance,

Regards,

MrFred.

.