Subject Re: [firebird-support] Updating uncle and cousin tables in a trigger using UPDATE
Author Svein Erling Tysvaer
in general I think updating of other tables ought to be done in AFTER
INSERT/UPDATE triggers, not BEFORE INSERT/UPDATE, but if you ask me why, I
have no idea. As an alternative to your FOR SELECT, you could use

UPDATE "Description" D
SET D."Total" = D."Total" + NEW."Quantity"
SELECT * FROM "Inventory Location" IL
WHERE D.ID = IL."Description ID"
AND IL.ID = NEW."Inventory Location ID")

This should work, but will (probably) be slower than your FOR SELECT if
your "Description" table contains lots of records.

At 16:40 17.07.2003 +0930, you wrote:
>This is what I want to do that isn't in the language:
> FOR "Adjustment"
> UPDATE "Description" D JOIN "Inventory Location" IL
> ON D.ID = IL."Description ID"
> SET D."Total" = D."Total" + NEW."Quantity"
> WHERE IL.ID = NEW."Inventory Location ID";