I have 2 related table: CREATE TABLE Ingredients( ID INTEGER PRIMARY KEY, name TEXT, description BLOB, property_ID INTEGER );
CREATE TABLE Properties( ID INTEGER PRIMARY KEY, price double ); When I create a new Ingredient I would like to create a new property for this ingredient and setup its property_ID. because there is no stored procedure I was thinking to use a trigger like this one: CREATE TRIGGER create_ingredients_property AFTER INSERT ON Ingredients FOR EACH ROW BEGIN INSERT INTO Properties () VALUES (); UPDATE Ingredients SET property_ID=ROWID WHERE ID=OLD.ID; END; but it doesn't work.... I could do with some help for the SQL syntax :D