--- Brad Paul <bpaul@carolina.rr.com> wrote:
> I have also tried:
>
> create rule inventory_usage_insert_rule as
> on insert to inventory_usage
> do
> update inventory set
> new.in_stock=old.in_stock-inventory_usage.used
> where
> inventory.inventory_id=inventory_usage.inventory_id;
>
Try recoding it as :
CREATE RULE inventory_usage_insert_rule AS
ON INSERT TO inventory_usage
DO
UPDATE inventory
SET in_stock = in_stock - NEW.used
WHERE inventory.inventory_id =
NEW.inventory_id;
Hope this helps,
ludwig.
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com