- 论坛徽章:
- 0
|
现在是我有一个user01的数据库,里面一个Matches表
我是当里面的status列改变时并且match_type字段改变是触发条件,更改Match_result列的值!
status和match_type都是枚举字段!就固定的值,start ,no_start,finish, match_type列是1
DELIMITER $$
CREATE TRIGGER match_after_insert AFTER INSERT ON Matches FOR EACH ROW
BEGIN
IF NEW.status = 'not_start' or NEW.status = 'start' or NEW.status = 'finish' and NEW.match_type = '1' THEN
SET 'NEW.Match_result' = '123456';
END IF;
END$$
DELIMITER ;
Match_result'这个表命名是存在的,为什么老是错误?
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''NEW.Match_result' = ‘123456’;
END IF;
END' at line 4
假使Match_result这个表在另一个数据库USER里面!改如何操作?谢谢!
[ 本帖最后由 xyfxh 于 2007-10-11 11:14 编辑 ] |
|