help me on a trigger

Поиск
Список
Период
Сортировка
От Pedro
Тема help me on a trigger
Дата
Msg-id 9f2d5e960606012309i6be0c0cbp57a7fa968208d06b@mail.gmail.com
обсуждение исходный текст
Ответы Re: help me on a trigger  (Terry Lee Tucker <terry@esc1.com>)
Список pgsql-general
I need to create a trigger that decreases on a "stocks" table the amount that have been inserted on the "tooken_from_stock" table.

the trigger should be something like:

CREATE TRIGGER triggerdecrease
BEFORE INSERT ON tooken_from_stock
EXECUTE PROCEDURE decrease();


then i need to create the procedure decrease that gets the inserted "tooken_from_stock.amount" and subtracts it on "stocks.amount "

can anybody help me with this please?

thanks in advance.

В списке pgsql-general по дате отправления:

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Restoring databases from a different installment on Windows
Следующее
От: Terry Lee Tucker
Дата:
Сообщение: Re: help me on a trigger