我這個轉換到MySQL從MSSQL,但它給我這個錯誤:轉換的Microsoft SQL到mysql
錯誤代碼:1415不允許從函數返回的結果集
什麼我做錯了嗎?
DELIMITER $$
CREATE FUNCTION GetPositionList (orderDetID NUMERIC)
RETURNS NVARCHAR(200)
DETERMINISTIC
BEGIN
DECLARE strToReturn NVARCHAR(50);
DECLARE strPos NVARCHAR(50);
DECLARE strPosOtherRes NVARCHAR(50);
DECLARE strTPos NVARCHAR(50);
DECLARE strTPosOtherResr NVARCHAR(50)
SET strToReturn = '';
SET strPos = SELECT `POSITION` FROM orderdetails WHERE OrderID = orderDetID;
SET strPosOtherRes = SELECT SecPosition FROM orderdetails WHERE OrderID = orderDetID;
SET strTPos = SELECT TeamPosition FROM orderdetails WHERE OrderID = orderDetID;
SET strTPosOtherResr = SELECT TeamSecPosition FROM orderdetails WHERE OrderID = orderDetID;
IF(strPos != '') THEN SET strToReturn = CONCAT(strPos , ',');
END IF;
IF(strPosOtherRes != '') THEN SET strToReturn = CONCAT(strToReturn , strPosOtherRes , ',');
END IF;
IF(strTPos != '') THEN SET strToReturn = CONCAT(strToReturn , strTPos , ',');
END IF;
IF(strTPosOtherResr != '') THEN SET strToReturn = CONCAT(strToReturn , strTPosOtherResr , ',');
END IF;
RETURN SUBSTRING(strToReturn, 0, LENGTH(strToReturn));
END $$
DELIMITER ;
問題是什麼? – 2012-08-03 07:29:33
Stackoverflow不是一個通用轉換器。請閱讀常見問題http://stackoverflow.com/faq#questions – 2012-08-03 07:31:23
我從mssql轉換成mysql,但它給了我這個錯誤:'錯誤代碼:1415不允許從函數返回結果集' – Raheel 2012-08-03 08:26:58