我试图将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