我嘗試做以下SELECT CASE和CALL程序
SELECT CASE @st
WHEN 'emp' THEN CALL empata(NEW.eqvis)
WHEN 'loc' THEN CALL pierde(NEW.eqvis)
WHEN 'vis' THEN CALL gana(NEW.eqvis)
END
INTO @dat;
但我得到了這一點:
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CALL empata(NEW.eqvis)
WHEN 'loc' THEN CALL pierde(NEW.eqvis)
WHEN' at line 18
但如果我刪除了 「呼叫」 我得到了一個"Function db.xxx not found"
什麼即時做錯了?
可能的重複http://stackoverflow.com/questions/7871260/mysql-calling-stored-procedures-inside-an-select-case-on-a-trigger – Nonym 2011-12-28 01:18:19