is
type kol_dep is record (sum_sal number,
min_sal number,
max_sal number,
names varchar2(1000),
dep_id number);
type kol_dep_tb is table of kol_dep;
v_kol_dep_tb kol_dep_tb;
function get_zp (proc_tbl kol_dep_tb) return kol_dep_tb pipelined;
end pkg_agg_employees;
---------TELO PAKETA-------
create or replace package body pkg_agg_employees
is
function get_zp (proc_tbl kol_dep_tb) return kol_dep_tb pipelined
is
v_report_row kol_dep;
cursor c_dep
is
select e.department_id as dep,
sum(e.salary)sum_sal,
min(e.salary)min_sal,
max(e.salary)max_sal,
listagg(e.first_name||' '||e.last_name|| ', '||chr(10))within group (order by e.last_name) as names
from employees e
inner join departments dep
on e.department_id=dep.department_id
inner join jobs j
on e.job_id=j.job_id
group by e.department_id
order by e.department_id;
begin
for r in c_dep loop
v_report_row:=null;
v_report_row.dep_id:=r.dep;
v_report_row.sum_sal:=r.sum_sal;
v_report_row.min_sal:=r.min_sal;
v_report_row.max_sal:=r.max_sal;
v_report_row.names:=r.names;
pipe row (v_report_row);
end loop;
return;
close c_dep;
end get_zp;
end pkg_agg_employees;```
не понимаю куда вставить
```DECLARE
v_table pkg_agg_employees.kol_dep_tb;
BEGIN
v_table := pkg_agg_employees.kol_dep_tb();
SELECT *
FROM TABLE(pkg_agg_employees.get_zp(v_table));
END; ```
или как по-другому исправить эту ошибку?