1

我越来越

错误代码:1305。FUNCTION acdb_extended.player 不存在

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

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

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);

关于哪里出错的任何提示?

4

2 回答 2

1

在这一行

IF player (account_number) = accountNumber

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

于 2012-06-28T12:59:20.197 回答
0

在这里,您在 BEGIN 之后使用了 Player 作为函数。

BEGIN IF player (account_number) = accountNumber

于 2012-06-28T13:00:07.580 回答