Re: a rule question
| От | Ludwig Lim |
|---|---|
| Тема | Re: a rule question |
| Дата | |
| Msg-id | 20021023160532.89482.qmail@web80310.mail.yahoo.com обсуждение исходный текст |
| Ответ на | a rule question (Brad Paul <bpaul@carolina.rr.com>) |
| Список | pgsql-novice |
--- 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
В списке pgsql-novice по дате отправления: