CREATE OR REPLACE FUNCTION Total_purchase_sum
RETURN NUMBER IS
record_1 employee.emp_salary%ROWTYPE;
sum NUMBER(7,2):=0;
TYPE Curs_var_type IS REF CURSOR;
Curs_var Curs_var_type;
BEGIN
OPEN Curs_var FOR SELECT * FROM employee A;
LOOP
FETCH Curs_var INTO record_1;
IF Curs_var%NOTFOUND THEN
EXIT;
END IF;
sum:=sum+record_1.Purchase_sum;
END LOOP;
CLOSE Curs_var;
RETURN sum;
END Purchase_sum;
error
Errors: FUNCTION TOTAL_PURCHASE_SUM
Line/Col: 14/9 PLS-00103: Encountered the symbol "+" when expecting one of the following:
(
The symbol "(" was substituted for "+" to continue.
Line/Col: 14/31 PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( ) * @ % & - + / at mod remainder rem <an exponent (**)>
||
The symbol ")" was substituted for ";" to continue.
Line/Col: 17/11 PLS-00103: Encountered the symbol ";" when expecting one of the following:
(