My query is
create or replace procedure TEMP_ARRAy_RECORD2
is
--type emp_det_tbl IS TABLE OF temp_employee_det%ROWTYPE index by pls_integer;
type lemp_det IS RECORD
(
--l_emp_id int,
l_emp_id temp_employee_det.emp_id%type,
l_city temp_employee_det.city%type,
l_amount temp_employee_det.amount%type
);
TYPE emp_det IS VARRAY(15) OF lemp_det;
f_emp_det emp_det;
BEGIN
for i in (select emp_id,city,amount BULK COLLECT into f_emp_det from temp_employee_det)
loop
dbms_output.put_line(i.emp_id||'$'||i.city||'$'||i.amount);
exit when SQL%NOTFOUND;
end loop;
end;
Now show my output
SQL*Plus statement executed
PL/SQL block executed
1$NASHIK$100
1$NASHIK$50
2$PPPPP,KK,JJ$45
2$KKKK,KK,$50
2$KKKK,kk$300
5$PPPPP$15.07
3$PPPPP$15.507
4$NASHIK$122
But my expected output is
1$NASHIK$1001$NASHIK$502$PPPPP,KK,JJ$452$KKKK,KK,$502$KKKK,kk$3005$PPPPP$15.073$PPPPP$15.504$NASHIK$122
I have tried on Index By Table and Varray but not get proper answer. Please don't use any function and other. I want this output in an array.