我创建了一个触发器,该触发器在另一个表中删除一行后在表中插入一行。
这是我的触发器
CREATE TRIGGER trigger_delete_log_animal AFTER delete ON animal
FOR EACH ROW
INSERT INTO log_animais (momento, ocorrencia)
VALUES (now(), "The register '" + old.nome_animal + "' was deleted from the animal table");
我希望 nome_animal 在单引号之间。
但是当我从动物表中删除一行时出现以下错误:
Error Code: 1292. Truncated incorrect DOUBLE value: 'The register ''
我试过把它改成
'The register "' + old.nome_animal + '" was deleted from the animal table'
而且还要
"The register \'" + old.nome_animal + "\' was deleted from the animal table"
但这并不好。
我究竟做错了什么?