I'm trying to convert a MS SQL Function to Oracle Function, but I'm getting errors and I cannot understand what errors or how to fix them.
Can anyone help:
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;
Errors
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