Question regarding triggers

Поиск
Список
Период
Сортировка
От Dmitri Fuerle
Тема Question regarding triggers
Дата
Msg-id 20031020130058.61589.qmail@web60210.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Question regarding triggers  (achill@matrix.gatewaynet.com)
Список pgsql-sql
 
   I'm writing a trigger but running into problems.  My problem is that I can not determine anyway to tell what fields are in the *new* record.  Without knowing what fields are there I get runtime errors if that's not what is being updated example:
 
CREATE FUNCTION "public"."check_shipment" () RETURNS trigger AS'
begin
    If new.shipment_type_id = 4 then
        --do something
    end if;
    return new;
end;
 
in the above example everything works if shipment_type_id is being updated.  If it is not I will receive a run-time error because shipment_type_id is not part of the record new.
 
Please help,
Dmitri
 


Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

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

Предыдущее
От: "Kumar"
Дата:
Сообщение: Scripting only the functions
Следующее
От: achill@matrix.gatewaynet.com
Дата:
Сообщение: Re: Question regarding triggers