如果表结构只对应一个字段,可以 select col1 bulk collect into 变量,不用游标循环,简洁高效
create or replace function get_airway_subpoint(awid in number)
return airway_subpnts_tab is
--CREATE OR REPLACE TYPE AIRWAY_SUBPNTS_TAB as table of number(11)
v_ptns airway_subpnts_tab;
--返回航路所有点id
begin
select f2.airway_point1 bulk collect into v_ptns from RTE_SEG f1,segment f2
where f1.en_route_rte_id =14595 and
f1.segment_id =f2.segment_id and
f1.code_sort>=4 and
f1.code_sort<=13;
return v_ptns;
end get_airway_subpoint;