Как найти сумму в oracle pl SQL
Привет,
Я делаю поиск среднего кода в pl sql, но получаю ошибку.
Ниже я даю пробный код с ошибкой.
DECLARE type namearray IS VARRAY(5) OF VARCHAR2(10); type grade IS VARRAY(5) OF INTEGER; names namearray; marks grade; total integer; sum integer := 0; BEGIN names := namearray('Kavita', 'Pritam', 'Ayan', 'Rishav', 'Aziz'); marks := grade(98, 97, 78, 87, 92); total := names.count; dbms_output.put_line('Total '|| total || ' Students'); FOR i in 1 .. total LOOP sum:= sum + marks(i); dbms_output.put_line(marks(i)); END LOOP; dbms_output.put_line(sum / total); END;
Ошибка
---------------------
ORA-06550: line 14, column 11: PLS-00103: Encountered the symbol "+" when expecting one of the following: ( The symbol "(" was substituted for "+" to continue. ORA-06550: line 14, column 21: PLS-00103: Encountered the symbol ";" when expecting one of the following: . ( ) * % & - + / at mod remainder rem || The symbol ")" was substituted for ";" to continue. ORA-06550: line 17, column 26: PLS-00103: Encountered the symbol "/" when expecting one of the following: (
Что я уже пробовал:
...................................................................................................