got strange error "Correlation name 'Club' not found" but the table Club is in the DB. I think the problem is after inserting the values:
ALTER TRIGGER "tg_add_club" AFTER INSERT,
UPDATE ON Club
REFERENCING NEW AS item
FOR EACH ROW
WHEN (item.address NOT IN (SELECT name FROM Place))
BEGIN
//DECLARE i_id INTEGER;
INSERT INTO Place(name)
VALUES (item.address);
//SELECT @@identity INTO i_id;
UPDATE Club SET place = (SELECT id FROM Place WHERE name=item.address)
WHERE Name = item.name; //AND Place.name = item.address;
END
I think the problem is somewhere after VALUES (item.address), but I'm not sure.
Have tried different things with it, but still nothing works. Thanks for reading!