Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Encountered the symbol "END" when expecting one of the following:

User_E0YYQDec 9 2021 — edited Dec 9 2021

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:

(

This post has been answered by Solomon Yakobson on Dec 9 2021
Jump to Answer
Comments
Post Details
Added on Dec 9 2021
4 comments
642 views