gpt4 book ai didi

未创建 MySQL 存储过程

转载 作者:行者123 更新时间:2023-11-29 02:03:31 25 4
gpt4 key购买 nike

所以我有这个存储过程,它在我运行文件时不会被创建。

DELIMITER //

DROP PROCEDURE IF EXISTS msd.test_proc//
CREATE PROCEDURE msd.test_proc()
BEGIN

SELECT
'Hello proc'
FROM
msd.zipcode_lookup;

END//
DELIMITER ;

当我运行它时,当我在 RazorSQL 中执行时,我在第 1 行收到错误代码 1064。这是完整的错误消息:

ERROR: 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 '//
CREATE PROCEDURE msd.test_proc()
BEGIN

SELECT

'Hello proc'
FROM ' at line 1
Error Code:1064

我尝试了其他变体,但仍然出现错误。我确信这是我所缺少的基本东西。感谢您的帮助。

谢谢。

最佳答案

RazorSQL website 中所述:

The DELIMITER statement is not part of the MySQL language. It is a command supported by certain MySQL tools. This command tells those MySQL programs to scan for a certain character that indicates the end of a query or statement.

RazorSQL does not support using the DELIMITER command. The SQL statement delimiter value used by RazorSQL can be changed using the preferences window. The default values is the semi-colon.

关于未创建 MySQL 存储过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10529090/

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