Hi, Le 2014-03-19 à 16:19, Adrian Klaver a écrit :
Is there an example missing here?
That doesn't seem to work? CREATE OR REPLACE FUNCTION validate_arrays_sum_equals_total() RETURNS TRIGGER AS $$ DECLARE total bigint; array_sum bigint; BEGIN EXECUTE 'SELECT $1 FROM ' NEW.* INTO total USING TG_ARGV[0]; RAISE EXCEPTION 'Total: %, social_impressions: %', total, NEW.social_impressions; RETURN NEW; END $$ LANGUAGE plpgsql; psql:db/functions.sql:117: ERROR: syntax error at or near "." LINE 6: EXECUTE 'SELECT $1 FROM ' NEW.* INTO total USING TG_ARGV[0... ^ Thanks, François |
<<attachment: smime.p7s>>