gpt4 book ai didi

MySQL 错误 : 1305. 存储过程

转载 作者:行者123 更新时间:2023-11-29 00:43:30 24 4
gpt4 key购买 nike

我得到了

Error Code: 1305. FUNCTION acdb_extended.player does not exist

当我尝试调用存储过程时。该错误的奇怪之处在于“玩家”不是存储过程的名称。

这是存储过程代码,它可能有很多问题,但据我所知它是正确的:

CREATE PROCEDURE `acdb_extended`.`addAllianceMember` (IN accountNumber VARCHAR(255),
IN userName VARCHAR(255), IN serverInitial CHAR(1), IN galaxy TINYINT(2),
IN region TINYINT(2), IN system TINYINT(2), IN astro TINYINT(2), IN level TINYINT(2))
BEGIN
IF player (account_number) = accountNumber
THEN REPLACE INTO player (username)
VALUES (userName);
ELSE INSERT INTO player (account_number, username)
VALUES (accountNumber, userName);
END IF;

IF coordinates (server_initial) = serverInitial AND
coordinates (galaxy) = galaxy AND
coordinates (region) = region AND
coordinates (system) = system AND
coordinates (astro) = astro
THEN REPLACE INTO coordinates (player_ID)
VALUES ((SELECT player_ID FROM player WHERE username = userName));
ELSE INSERT INTO coordinates (player_ID, server_initial, galaxy, region, system, astro)
VALUES ((SELECT player_ID FROM player WHERE username = userName), serverInitial,
galaxy, region, system, astro);
END IF;

IF jumpgate (player_ID) = (SELECT player_ID FROM player WHERE username = userName) AND
jumpgate (coordinates_ID) = (SELECT c.coordinates_ID FROM coordinates c, player p WHERE c.player_ID = p.player_ID
AND p.username = userName)
THEN REPLACE INTO jumpgate (level)
VALUES (level);
ELSE INSERT INTO jumpgate (player_ID, coordinates_ID, level, usable)
VALUES ((SELECT player_ID FROM player WHERE username = userName),
(SELECT c.coordinates_ID FROM coordinates c, player p WHERE c.player_ID = p.player_ID
AND p.username = userName), level, TRUE);
END IF;
END

下面是我用来测试它的 SQL 语句:

CALL addAllianceMember(8494618, 'Carl', 'G', 29, 08, 10, 01, 04);

有什么地方出错的提示吗?

最佳答案

在这一行

IF player (account_number) = accountNumber

它像函数一样调用播放器,看起来播放器并不作为函数存在。

关于MySQL 错误 : 1305. 存储过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11245156/

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