Oracle table()函数用法
来源:互联网 发布:邮件服务器linux 编辑:程序博客网 时间:2024/04/30 08:15
转自:http://blog.csdn.net/fw0124/article/details/6950374
利用table()函数,我们可以将PL/SQL返回的结果集代替table。
1、table()结合数组:
create or replace type t_test as object(
id integer,
rq date,
mc varchar2(60)
);
create or replace type t_test_table as table of t_test;
create or replace function f_test_array(n in number default null) return t_test_table
as
v_test t_test_table := t_test_table();
begin
for i in 1 .. nvl(n,100) loop
v_test.extend();
v_test(v_test.count) := t_test(i,sysdate,'mc'||i);
end loop;
return v_test;
end f_test_array;
/
select * from table(f_test_array(10));
select * from the(select f_test_array(10) from dual);
2、table()结合PIPELINED函数:
create or replace function f_test_pipe(n in number default null) return t_test_table PIPELINED
as
v_test t_test_table := t_test_table();
begin
for i in 1 .. nvl(n,100) loop
pipe row(t_test(i,sysdate,'mc'||i));
end loop;
return;
end f_test_pipe;
/
select * from table(f_test_pipe(20));
select * from the(select f_test_pipe(20) from dual);
3、table()结合系统包:
create table test (id varchar2(20));
insert into test values('1');
commit;
explain plan for select * from test;
select * from table(dbms_xplan.display);
- oracle table()函数用法
- oracle table()函数用法
- Oracle table()函数用法
- oracle table()函数用法
- oracle table()函数用法
- Oracle table()函数用法
- oracle table()函数用法
- PL/SQL表(oracle内存表)---table()函数用法
- PL/SQL表(oracle内存表)---table()函数用法
- PL/SQL表(oracle内存表)---table()函数用法
- Oracle PLsql table用法
- oracle table()函数应用;
- oracle table 函数
- oracle drop table的用法
- oracle中的temporary table用法
- oracle table()函数的使用
- Oracle函数返回Table集合
- Oracle杂文:table函数使用
- 黄奕发律师函正式提出离婚:曾多次遭家暴
- http://dongxi.douban.com/article/1305337/
- SVN命令总结
- C++异常处理机制
- 经典排序算法
- Oracle table()函数用法
- Swift学习 --- 2.6函数
- Cocos2D-X2.2.3学习笔记16(缓存机制)
- 关于pragma pack的用法C++中的内存对齐问题
- android 获取系统时间
- 生成所有不重复的组合
- MTK平台修改音量默认值需要改动的位置
- 从30岁到35岁:为你的生命多积累一些厚度
- 文章出轨门后马伊琍首公开现身 与友人紧握手认真观展