create
or
replace
function
tf_test
return
apex_t_varchar2
is
lt apex_t_varchar2 := apex_t_varchar2();
-- ORA-06531: Reference to uninitialized collection
begin
for
i
in
1..12 loop
lt.extend;
-- ORA-06533: Subscript beyond count
lt(lt.
last
) := add_months(trunc(sysdate,
'yy'
),i-1);
end
loop;
return
(lt);
end
;
/
select
column_value
as
dt
from
tf_test();
DT
---------
01/JAN/19
01/FEB/19
01/MAR/19
01/APR/19
01/MAY/19
01/JUN/19
01/JUL/19
01/AUG/19
01/SEP/19
01/OCT/19
01/NOV/19
01/
DEC
/19
12
rows
selected
No comments:
Post a Comment