gpt4 book ai didi

mysql-8.0 - 尝试在 MySQL 8 中执行过程时出现 "Commands out of sync"错误

转载 作者:行者123 更新时间:2023-12-05 07:14:07 25 4
gpt4 key购买 nike

在 phpMyAdmin 中执行以下代码时:

use db;
DELIMITER $$
DROP PROCEDURE IF EXISTS McaTest3$$
CREATE PROCEDURE McaTest3()

BEGIN

SELECT
cl.*
FROM `condition_library` cl
LEFT JOIN condition_custom cc on cl.condition_library_id = cc.condition_library_id
and cc.active = 1
AND (cc.permit_application_id = 20231 OR cc.permit_id = NULL)
WHERE FIND_IN_SET(cl.`condition_library_id`, '13070')
AND cl.active = 1
and cc.condition_library_id IS NULL;

END$$
DELIMITER ;

call McaTest3();

获取错误:

Error Static analysis:

1 errors were found during analysis.

Missing expression. (near "ON" at position 25) SQL query: Edit Edit

SET FOREIGN_KEY_CHECKS = ON;

MySQL said: Documentation

#2014 - Commands out of sync; you can't run this command now

当在 LEFT JOIN 的表中找不到记录时,会发生这种情况。

在 MySQL Workbench 中运行时:无错误并返回空数据集。

从应用程序 (Appian) 执行时,同样的过程也失败了……任何线索

最佳答案

Stackoverflow 上的另一个问题回答了我的问题:

链接:MySQL error #2014 - Commands out of sync; you can't run this command now

关于mysql-8.0 - 尝试在 MySQL 8 中执行过程时出现 "Commands out of sync"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59981618/

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