I am trying to make a boolean become true when the sum of three integers is equal to 100 and false when the sum is not equal to 100.
I am making a trigger function in Postgres to do that, but getting the following error:
ERROR: «db_fondos.checksize» is not a known variable
LINE 6: DB_Fondos.CheckSize=true;
I hope you could help me. Code:
CREATE FUNCTION check_sum()
RETURNS TRIGGER
AS $$
BEGIN
IF DB_Fondos.SizeLarge+DB_Fondos.SizeMid+DB_Fondos.SizeSmall=100 then
DB_Fondos.CheckSize=true;
END IF;
RETURN NEW;
END;
$$
LANGUAGE plpgsql;