Cascading Updates In Derby Query?
- From: "Bloggs" <MrFredBloggs@xxxxxxxxxxx>
- Date: 23 Jan 2006 17:31:02 -0800
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.
.
- Follow-Ups:
- Re: Cascading Updates In Derby Query?
- From: Dyreatnews
- Re: Cascading Updates In Derby Query?
- Prev by Date: Re: select 10000 rows from Oracle in shortest way
- Next by Date: newbie question: processing large database in chunks?
- Previous by thread: after Oracle restart
- Next by thread: Re: Cascading Updates In Derby Query?
- Index(es):