我一直在使用pl / sql一段时间..而且我对mysql程序中的变量有点困惑。
我正在尝试创建一个程序,我无法将其编译:(
我得到的错误:
下载完整的代码
CREATE DEFINER = CURRENT_USER PROCEDURE `NewProc`()
BEGIN
SET @city = FLOOR(RAND() * 5);
SET @uid = 3948;
SET @alive = (select alive from users where id = @uid);
SET @thread_id = 2950;
set @post_content = "AAAAOOOAAA! Jeg er i ";
if (@alive = 1) THEN
# Move NPC over to a random city
UPDATE users set city = @city where id = @uid;
# post a post on the forum thread
INSERT INTO forum_posts (
author,
thread,
creationdate,
content,
) values (
@uid,
@thread_id,
UNIX_TIMESTAMP(),
@post_content
);
END IF;
END;;
你们中的任何人都知道我做错了:)?