【 使用环境 】生产环境 or 测试环境
【 OB or 其他组件 】
【 使用版本 】
【问题描述】清晰明确描述问题
【复现路径】问题出现前后相关操作
【附件及日志】推荐使用OceanBase敏捷诊断工具obdiag收集诊断信息,详情参见链接(右键跳转查看):
【备注】基于 LLM 和开源文档 RAG 的论坛小助手已开放测试,在发帖时输入 [@论坛小助手] 即可召唤小助手,欢迎试用!
obclient(root@sys)[ECommerceSys]> create trigger cal_sub_upd
→ before update on orderitems
→ referencing NEW as nrow
→ for each row
→ when (nrow.ProductID <> OLD.ProductID or nrow.Quantity <> OLD.Quantity or NEW.NEED_RECALCULATE = true)
→ begin
→ select Price into nrow.subtotal
→ from Products
→ where ProductID = nrow.productID;
→ set nrow.subtotal = nrow.subtotal * nrow.Quantity;
→ set nrow.NEED_RECALCULATE=false;
→ end$$
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ‘referencing’ at line 3
referencing语句报错;去掉referencing语句后when报错。但是 (https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000221226)中没有说不可以这样做?