oracle 巢狀表各種使用方法示例

2021-06-03 10:03:15 字數 1479 閱讀 4746

create or replace package dp_nest_test is

function get_lx3_types return t_nest_type;

function ret_lx3_point(r sys_refcursor) return t_nest_type;

function ret_pipe return t_nest_type_r pipelined;

end;

/create or replace package body dp_nest_test is

function get_lx3_types return t_nest_type is

v_nest_type t_nest_type:=t_nest_type('');

begin

select type bulk collect into v_nest_type from lx3;

return v_nest_type;

end;

function ret_lx3_point(r sys_refcursor) return t_nest_type is

v_nest_tab t_nest_type:=t_nest_type();

k int :=1;

t varchar2(200);

begin

loop

fetch r into t;

if r%notfound then

exit;

end if; 

v_nest_tab.extend;

v_nest_tab(k):=t||'('||ascii(t)||')';

k:=k+1; 

end loop;

return v_nest_tab;

end;

function ret_pipe return t_nest_type_r pipelined is 

v_lx3_r r_lx3:=r_lx3('','');

begin

for i in(select xh,type from lx3) loop

v_lx3_r.xh:=i.xh;

v_lx3_r.type:=i.type;

--pipe row(v_lx3_r); 

pipe row(r_lx3(i.xh,i.type));

end loop;

return;

end;

end;

/select * from table(cast(dp_nest_test.get_lx3_types as t_nest_type));

select *

from table(dp_nest_test.ret_lx3_point(cursor (select type as t_nest_type

from lx3)));

select * from table(dp_nest_test.ret_pipe);

DSPack各種使用方法

首先,要閱讀一下 dspackdir help目錄下的help.chm檔案,粗略地看了一下,內容太多看不出頭緒。還是先學習一下 dspackdir demos d6 d7目錄下的那些例子,邊動手做邊學習吧。看得差不多後,自己照葫蘆畫瓢仿製乙個。1.新建乙個應用,在介面上先放4 5個按鈕。2.在控制項...

vue 各種使用方法

安裝 vue cli3 安裝 vue cli npm install g vue cli 建立乙個專案 vue create baifubin 開啟圖形化介面 vue ui 安裝 vue 移動端rem 通過cli3 直接搜尋或npm npm install postcss pxtorem postc...

AutoLayout的各種使用方法

關於autolayout 下面通過乙個簡單的列子分別演示autolayout的各種使用方法 需求是在控制器view底部新增2個view,1個藍色,1個紅色2個view寬度 高度永遠相等距離父控制項左邊 右邊 下邊間距和2個view之間的間距相等,效果如下圖 橫屏效果 橫屏效果 豎屏效果 豎屏效果 在...