This is the Oracle 11g PL/SQL code I am trying to run:
declare
a char;
count_n number(4):=0;
average number(4):=0;
sum_n number(4):=0;
begin
loop
a:=&a;
if a='Z' then
goto end_input;
exit;
end if;
count_n:=count_n+1;
sum_n:=sum_n+to_number(a);
end loop;
<<end_input>>
average:=sum_n/count_n;
end;
/
I am getting this error: ERROR at line 1: ORA-06502: PL/SQL: numeric or value error: number precision too large ORA-06512: at line 13
Can anyone help me out please?