Hi Lloyd,
i am not sure, but i checked the documentation and i don't think it ist
sound.
In your Update, the ROWID semms to refer to ingredients.rowid. However,
you want to set properties.rowid.
Can it be that it works, because Properties and Ingredients happen to
have the same number of rows?
Martin
Lloyd Dupont schrieb:
thanks Martin it worked!
although I replaced your (SELECT MAX(ID) FROM Properties) by ROWID.
is it sound?
like that:
CREATE TRIGGER create_ingredient_property AFTER INSERT ON Ingredients
BEGIN
INSERT INTO Properties (price) VALUES (NULL);
UPDATE Ingredients
SET property_ID = ROWID
WHERE ID=OLD.ID;
END;
-- price doesn't matter. I set it up much later.. (whenever the user
want, in fact), but I want my property line created and correctly linked!