What's that stuff about recursion?
CREATE TABLE a (
id int(11) NOT NULL auto_increment primary key,
ref int,
updttime datetime
);
DELIMITER |
CREATE TRIGGER buildref AFTER INSERT ON a
FOR EACH ROW BEGIN
UPDATE a SET a.ref = NEW.id, a.updttime = NOW() WHERE a.id = NEW.id;
END;
|
DELIMITER ;
insert into a values(0,0,0) should work!
What's so recursive about that? The record is created and an update should occur.
There is no way to invoce AFTER INSERT again, because it's not INSERT but UPDATE.
What's wrong with that? It runs in Oracle and Informix. Can't find any reason why this should not work!