I'm getting the error below when I try to insert into SQLite.
Error while executing SQL query on database 'BDTEST': too many levels of trigger recursion
Creating the table
CREATE TABLE INSTANCES (
ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
NAME varchar(255) NOT NULL UNIQUE,
DESCRIPTION text,
CONFIG_TXT text,
EXTRA_TXT text,
CREATED varchar(50) NULL,
MODIFIED varchar(50) NULL
);
Creating Trigger
CREATE TRIGGER INSTANCE_INSERT AFTER INSERT ON INSTANCES
BEGIN
UPDATE INSTANCES SET CREATED = DATETIME('NOW') WHERE ID = NEW.ID;
END;
Creating the Trigger - Update
CREATE TRIGGER INSTANCE_UPDATE AFTER UPDATE ON INSTANCES
BEGIN
UPDATE INSTANCES SET MODIFIED = DATETIME('NOW') WHERE ID = OLD.ID;
END;
Insertion
INSERT INTO INSTANCES (NAME, DESCRIPTION, CONFIG_TXT, EXTRA_TXT)
VALUES
('app02', 'Intancia de teste Windows', 'blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah', '');