0
DELIMITER $$
DROP FUNCTION IF EXISTS `workplantype`.`FUN_STOCKINVENTRY_CHECK` $$
CREATE FUNCTION `workplantype`.`FUN_STOCKINVENTRY_CHECK` (
PONo1 VARCHAR(20),
PartCode1 VARCHAR(45)
) RETURNS bool
BEGIN
DECLARE diff bool;
set diff=false;
select if(Remaining_Quantity=0.00, true, false) as diff from tblstockinventory where PONo=PONo1 && PartCode=PartCode1;
return diff;
END $$
DELIMITER ;
如何避免不允許從函數返回結果集mysql錯誤?不允許從函數mysql錯誤返回結果集?
+1您按秒打我給它。請注意'@ diff'只需要'diff',因爲它是一個聲明變量。 – Mike 2010-07-12 12:35:09