I created below simple block but getting
ORA 06533:Subscript beyond count
error.
Can someone please tell me what I am missing in below code.
declare
type salaryvarray is varray(6) of customers.salary%type;
salary_array salaryvarray:=salaryvarray();
c_salary customers.salary%type;
i integer(2);
counter number(2);
begin
salary_array.extend;
select count(*) into counter from customers;
for i in 1..counter loop
select salary into c_salary from customers where id =i;
salary_array(i):=c_salary;
end loop;
end;
/