DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Get_Next_Processing_Video`(
OUT out_IDVideo INT ,
OUT out_YoutubeIDVideo VARCHAR(15)
)
BEGIN
DECLARE a INT;
DECLARE b VARCHAR(15);
set a = 0;
set b = "ciao";
SELECT NP.IDVideo, NP.YoutubeIDVideo INTO a, b
FROM next_processing AS NP
LIMIT 1;
UPDATE Video AS V
SET V.SchedulingFlag = TRUE
WHERE IDVideo = a;
SET out_IDVideo = a;
SET out_YoutubeIDVideo = b;
END
MySQL 返回:
例程 youtubedb.Get_Next_Processing_Video 的 OUT 或 INOUT 参数 1 不是 BEFORE 触发器中的变量或 NEW 伪变量。
问题是什么?代码似乎正确。
这是我的调用过程的 C# 代码:
using (MySqlConnection conn = new MySqlConnection(ConfigurationManager.ConnectionStrings["AxWaveConnection"].ToString()))
{
try
{
conn.Open();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
MySqlCommand cmd = new MySqlCommand("Get_Next_Processing_Video", conn);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.Add(new MySqlParameter("out_IDVideo", idVideo));
cmd.Parameters.Add(new MySqlParameter("out_YoutubeIDVideo", youtubeId));
try
{
cmd.ExecuteNonQuery();
}
catch (Exception e)
{
}
conn.Close();
}