Re: Fwd: function for trigger - Mailing list pgsql-general

From David G Johnston
Subject Re: Fwd: function for trigger
Date
Msg-id 1415379297215-5826066.post@n5.nabble.com
Whole thread Raw
In response to Fwd: function for trigger  (avpro avpro <avprowebeden@gmail.com>)
List pgsql-general
avpro avpro wrote
> 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

What you wrote makes no sense.

David J.




--
View this message in context: http://postgresql.1045698.n5.nabble.com/Fwd-function-for-trigger-tp5826063p5826066.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Fwd: function for trigger
Next
From: Devrim Gündüz
Date:
Subject: Re: Testing on Power 8 systems