第一次海報非常感謝任何幫助。帶日期輸入的MySQL程序失敗
我完全停留在MySQL存儲過程的問題上,對他們來說是完全綠色的。
以下是當前寫入的過程,MySQL在沒有任何問題的情況下接受它,所以除非出現語法錯誤,否則該過程將被正確寫入。
但是,當我呼叫過程 call test (2011-04-01, 2011-04-07);
沒有結果返回,但select語句工作得很好。
CREATE PROCEDURE `NewProc`(IN `@StartDate` date,IN `@EndDate` date)
BEGIN
SELECT aux1, aux2, aux3, aux4, date, id, type,
CASE
WHEN results = 'pass' THEN '1'
WHEN results = 'fail' THEN '0'
ELSE '-1'
END AS CertStatus,
CASE
WHEN results = 'pass' THEN '1'
WHEN results = 'fail' THEN '0'
ELSE '-1'
END AS TestStatus,
CASE
WHEN results = 'pass' THEN '1'
WHEN results = 'fail' THEN '0'
ELSE '-1'
END AS TestStatus,
CASE
WHEN results = 'pass' THEN '1'
WHEN results = 'fail' THEN '0'
ELSE '-1'
END AS TestStatus
from completed
WHERE date >= '@StartDate' and date <= '@EndDate';
END;
謝謝f00,這解決了我的問題。 – wolfsburg18 2011-04-12 18:13:49