我以前从未这样做过,但是为什么我在尝试创建此事件时不断收到错误消息。我正在使用 HeidiSql 来执行此操作。另外,可以在事件中使用 LOOPS、WHILE、IF ELSE 吗?
BEGIN
DECLARE x TIMESTAMP;
DECLARE y INT;
DECLARE a VARCHAR(50); // Here's where the error is.
SET x = current_timestamp();
insert into checked (stamp) values (x);
SELECT count(stamp) INTO y FROM checked;
IF y > 10 THEN// It also throws an error here.
a = 'PASS';
else
a = 'FAIL';
END IF;
insert into checked (timeCount) values (a);
END