0
工作我有一個MySQL的函數如下,但它產生的錯誤:MySQL的函數調用失敗,但在本地主機
BEGIN
DECLARE image1 VARCHAR(250);
select case when
(
select COUNT(*)
from profile_images
where building_id = bid
and contractor_id = cid
) > 0
then (
select distinct (image)
-- into image1
from profile_images
where building_id = bid
and contractor_id = cid limit 1
) else (
select distinct (image)
-- into image1
from profile_images
where contractor_id = cid limit 1
)
END into image1;
RETURN image1;
END
由MySQL所示的實際誤差是#2014 - 命令不同步;你現在不能運行這個命令。
您是否閱讀過手冊? https://dev.mysql.com/doc/refman/5.7/en/commands-out-of-sync.html –
是的。我只是從my-sql查詢窗口調用函數,但仍然失敗 –
在該文檔中提到關於光標,但我不知道如何處理光標 –