1
有任何問題:語法錯誤@鑄造new.value
DELIMITER ;;
CREATE TRIGGER `UPD_after_financialStatus` AFTER UPDATE ON `financialStatus`
FOR EACH ROW
BEGIN
DECLARE `@grossAmountTillNow` varchar(100);
SET @grossAmountTillNow = CONCAT(
CAST(OLD.grossAmountTillNow AS varchar(50)),
"---",
CAST(NEW.grossAmountTillNow AS varchar(50)));
...
它說Syntax error near 'varchar(50)),"---",CAST(NEW.grossAmountTillNow AS varchar(50))); SET @grossAmoun' at line 4
。
你能幫忙嗎?
你確定你可以在'CAST'裏面使用'varchar'嗎?根據[手冊](http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_cast)你不能... – Marco 2012-04-10 10:33:20
@Marco,我們可以使用'CAST() 'TRIGGER'裏面的內容' – diEcho 2012-04-10 10:35:53
@diEcho:是的,但是恕我直言'varchar'根據手冊不是有效的dest類型... – Marco 2012-04-10 10:36:46