SQLite does not currently support recursive triggers.
On of the main reasons for not supporting recursive
triggers is that disallowing recursive triggers was
seen as the easiest way to avoid infinite loops like
this:
CREATE TRIGGER loop AFTER UPDATE OF table1
BEGIN
UPDATE table1 SET cnt=(cnt+1)%100 WHERE rowid=old.rowid;
END;
UPDATE table1 SET cnt=1 WHERE rowid=1; -- Infinite loop
By disallowing recursive triggers, SQLite avoids the
infinite loop above. But there are useful things one
could do with recursive triggers that do not involve
infinite loops. I would like to relax the constraint
in SQLite and allow some support for recursive triggers
as long as the recursive triggers do not cause an
infinite loop. But I'm not sure how to do about it?
Question: What do other RDBMSes do with triggers that
form infinite loops? Does anybody know?
Question: Can anybody suggest a way of providing support
for recursive triggers which also guarantees that
every SQL statement will eventually complete?
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565