Can't use NEW keyword in trigger

Brenda Bell bb31l at theotherbell.com
Tue Aug 27 21:02:00 CDT 2013


I have a simple trigger that looks like this:

CREATE TRIGGER "trigger_yarn_compute_weight_grams"
	BEFORE INSERT
	ON "yarn"
	FOR EACH ROW
	WHEN weight_grams = 0
BEGIN
NEW.weight_grams = NEW.weight_ounces * 28.3495
END;

But when I try to save it, I get the following error:

near "NEW": syntax error

What am I doing wrong?




More information about the Valentina-studio mailing list