Fwd: function for trigger

From: avpro avpro <avprowebeden(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Fwd: function for trigger
Date: 2014-11-07 15:07:08
Message-ID: CAAQdDnnfVO2ePAWGQstOhHn2YG9_AdBoMXsfjkMFjs7Vh4YXcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have this function

CREATE OR REPLACE FUNCTION sumlast_func()
RETURNS trigger AS
begin
CASE
WHEN idcar = (select idcar FROM selectedcar) THEN
JOIN selectedcar ON selectedcar.idcar = actuals.idcar)
update actuals
set
comb = comb + (select combor from combor_view
where idlog = (select max(idlog) from combor_view)),
END CASE;
return new;
end

I'm not sure where to create the boolean condition; the options in the
function above or in the trigger below

CREATE TRIGGER update_actuals_tg
AFTER INSERT
ON combor
FOR EACH ROW
EXECUTE PROCEDURE sumlast_func();

and then, is the boolean condition wrong?
thanks for any tips

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-11-07 15:46:53 Re: Fwd: function for trigger
Previous Message Dan H 2014-11-07 15:02:57 reindex table deadlock