0

这是我的,代码:

DELIMITER $$
CREATE PROCEDURE `Get_Next_Processing_Video`
(   
    OUT out_IDVideo                   INT ,
    OUT out_YoutubeIDVideo          VARCHAR(15) 
)

BEGIN

    SELECT  NP.IDVideo INTO out_IDVideo
    FROM    next_processing AS NP
  Limit 1

    UPDATE TABLE    Video AS V 
    SET     V.SchedulingFlag = TRUE
    WHERE   IDVideo = out_IDVideo

END

我不明白错误在哪里?

4

1 回答 1

1

错误:

  • 你没有终止第一个SELECT语句
  • 你的关键字TABLE后面有一个。UPDATE

固定代码:

DELIMITER $$
CREATE PROCEDURE `Get_Next_Processing_Video`
(   
    OUT out_IDVideo                   INT ,
    OUT out_YoutubeIDVideo          VARCHAR(15) 
)

BEGIN

    SELECT  NP.IDVideo INTO out_IDVideo
    FROM    next_processing AS NP
    Limit 1; 

    UPDATE  Video AS V 
    SET     V.SchedulingFlag = TRUE
    WHERE   IDVideo = out_IDVideo;

END $$
DELIMITER ;

或者,您可以使用SET为变量分配值。

    SET out_IDVideo = (SELECT   NP.IDVideo 
                        FROM    next_processing AS NP
                        Limit 1); 
于 2013-01-29T14:13:16.947 回答