Oracle Fonksiyondan Array/Cursor/DataTable döndürme
TYPES
==================================================================================
CREATE OR REPLACE TYPE “T_EK_CZLG_19_5A_TABLE”
as table of T_EK_CZLG_19_5A_COL
CREATE OR REPLACE TYPE “T_EK_CZLG_19_5A_COL”
as object (
su_cazibe_1 varchar2(300),
su_cazibe_2 varchar2(300),
su_pompaj_3 varchar2(300),
kurutma_4 varchar2(300)
)
CREATE OR REPLACE TYPE table_19_5A_ARRAY is VARRAY(5000) OF t_ek_czlg_19_5a_col
FUNCTIONS
==================================================================================
create or replace function get_ek_czlg_19_5A_table(ParamPeriyod in integer)
RETURN table_19_5A_ARRAY AS
l_data table_19_5A_ARRAY := table_19_5A_ARRAY();
cursor c_proje is
select tblRow1.ad as su_cazibe_1 from
(select a.id,a.ad from sdb_nesne_degeri a where a.id_nesne_tipi= 502000) tblRow1,
(select p.id_ust_nesne_degeri,p.deger from sdb_periyodik_veri p where p.id_nesne_degeri=97144 and p.durum=0 and p.periyod=ParamPeriyod) tbl1
where
tblRow1.Id = tbl1.id_ust_nesne_degeri(+);
begin
for r1 in c_proje
loop
l_data.extend;
l_data(l_data.count) := t_ek_czlg_19_5a_col(r1.su_cazibe_1, ”, ”, ”);
end loop;
return l_data;
end get_ek_czlg_19_5A_table;
SELECT USE
==================================================================================
select * from table(get_ek_czlg_19_5A_table(2005))