我試圖將MS SQL函數轉換爲Oracle函數,但是出現錯誤,我無法理解錯誤或者如何解決它們。將MS SQL函數轉換爲Oracle函數拋出錯誤
誰能幫助:
CREATE OR REPLACE FUNCTION ItemsSold
(
p_PrdID nvarchar2(50),
p_Cst nvarchar2(50)
)
RETURN Number
AS
v_Price NUMBER(18,2);
BEGIN
SELECT (Min(s.Price)*i.Qty) AS MinP into v_Price
FROM Customers AS c INNER JOIN
CustOrders AS o ON c.Name = o.Cust INNER JOIN
Sales AS i ON i.Order = o.Order INNER JOIN
Purchases AS s ON i.Item = s.Item
WHERE i.Item = p_PrdID AND o.Cust = p_Cst
group by i.Qty)
RETURN v_Price;
END;
錯誤
Error(4,23): PLS-00103: Encountered the symbol "(" when expecting one of the following: := .) , @ % default character The symbol ":=" was substituted for "(" to continue.
Error(6,18): PLS-00103: Encountered the symbol "(" when expecting one of the following: := .) , @ % default character The symbol ":=" was substituted for "(" to continue.
Error(17,29): PLS-00103: Encountered the symbol "INNER" when expecting one of the following: , ; for group having intersect minus order start union where connect
通過i.Qty組後無分號) – kevinsky