MySQL Forums
Forum List  »  Triggers

Re: Can't create triggers w/5.0.18
Posted by: Francis Rotoloni
Date: February 15, 2006 12:55PM

I have tried 3 different query tools and I get the same error. I have tried the same code that's in the docs. Can anyone help?

CREATE TABLE test1(a1 INT);
CREATE TABLE test2(a2 INT);
CREATE TABLE test3(a3 INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
CREATE TABLE test4(
a4 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
b4 INT DEFAULT 0
);

DELIMITER |

CREATE TRIGGER testref BEFORE INSERT ON test1
FOR EACH ROW BEGIN
INSERT INTO test2 SET a2 = NEW.a1;
DELETE FROM test3 WHERE a3 = NEW.a1;
UPDATE test4 SET b4 = b4 + 1 WHERE a4 = NEW.a1;
END
|

DELIMITER ;



Thanks

Options: ReplyQuote


Subject
Views
Written By
Posted
2836
January 24, 2006 09:35PM
1985
January 25, 2006 09:46AM
Re: Can't create triggers w/5.0.18
1950
February 15, 2006 12:55PM
1795
February 15, 2006 06:48PM
1891
February 16, 2006 09:48AM
1640
February 16, 2006 03:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.