gpt4 book ai didi

mysql - 表触发器中的语法错误 @casting new.value

转载 作者:行者123 更新时间:2023-11-29 00:47:08 27 4
gpt4 key购买 nike

有什么问题吗:

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' 在第 4 行
你能帮忙吗?

最佳答案

请比较:

SELECT CAST(CURRENT_TIMESTAMP AS VARCHAR(50))

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 'VARCHAR(50))' at line 1

SELECT CAST(CURRENT_TIMESTAMP AS CHAR(50))

2012-04-10 12:30:29

允许的值在 Cast Functions and Operators 中有解释。 .

关于mysql - 表触发器中的语法错误 @casting new.value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10086992/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com