ERROR: SET FOREIGN_KEY_CHECKS = ON and #2014 - Commands out of sync; you can't run this command now

ERROR: SET FOREIGN_KEY_CHECKS = ON and #2014 - Commands out of sync; you can't run this command now

在 PHPMYADMIN 中,我想调用存储过程中的函数,所以我 运行 查询 这是一个,CALL funcpara ('karthick');

函数代码:

CREATE PROCEDURE `funcpara`(IN `uname` VARCHAR(255)) 
SELECT ct.CUST_NM, UPPER(CUST_NM) AS UppercaseCustomerName 
FROM customers ct
WHERE ct.CUST_NM = uname; 

我在上面的查询中为参数输入了一个输入值,出现错误显示是-

错误

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

有知道的给我解决方法,谢谢提前

您缺少 BEGINEND 以及 DELIMITER 部分。

尝试:

DELIMITER //
CREATE PROCEDURE funcpara(uname VARCHAR(255)) 
BEGIN
SELECT CUST_NM, UPPER(CUST_NM) AS UppercaseCustomerName 
FROM customers ct
WHERE CUST_NM = uname; 
END//
DELIMITER ;