这是我的代码:
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
我不明白错误在哪里?
答案 0 :(得分: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);