首页 > 数据库技术 > 详细

2015.1.15 利用Oracle函数插入表结构 Bulk collect into 不用循环,简洁高效

时间:2016-10-15 19:23:38      阅读:257      评论:0      收藏:0      [点我收藏+]

如果表结构只对应一个字段,可以 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;

2015.1.15 利用Oracle函数插入表结构 Bulk collect into 不用循环,简洁高效

原文:http://www.cnblogs.com/mol1995/p/5964822.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!