SQL> create or replace type myobjectype as object (x int,y date,z varchar2(50));
2 /Type created.SQL> create or replace type mytabletype as table of myobjectype
2 /Type created.SQL> create or replace function testrerecordnotabname (tableid in number)
2 return mytabletype
3 as
4 l_data mytabletype :=mytabletype();
5 begin
6 for i in (select * from a where id>=tableid) loop
7 l_data.extend;
8 l_data(l_data.count) := myobjectype(i.id,i.doctime,i.name);
9 exit when i.id = 62;
10 end loop;
11 return l_data;
12 end;
13 /
2 /Type created.SQL> create or replace type mytabletype as table of myobjectype
2 /Type created.SQL> create or replace function testrerecordnotabname (tableid in number)
2 return mytabletype
3 as
4 l_data mytabletype :=mytabletype();
5 begin
6 for i in (select * from a where id>=tableid) loop
7 l_data.extend;
8 l_data(l_data.count) := myobjectype(i.id,i.doctime,i.name);
9 exit when i.id = 62;
10 end loop;
11 return l_data;
12 end;
13 /
解决方案 »
- 看看这个按年/月/日汇总的SQL效率如何
- pl/sql 如何自动导出某表的记录为CSV文件呢?
- 在线急求:无比郁闷
- oracle安装完后不能进行管理工作
- 写一个FUNCTION 或者存储过程,关于几张表的查询 有点难度,大家帮忙
- 数据库怎样将成绩等级表和成绩表连接
- 怎样一次删除当前连接用户创建的所有的表?
- 说个题外话,大家不介意吧!
- 同样的连接串,用sqlplus就能连.为什么写在程序里不行????
- 如何在bat文件中调用sqlplus,并执行sql语句?最后一点血本,大虾们帮帮忙!!!急啊!
- 如何把纵向的数据 横向显示????
- 数据库报oracle-01033,怎么办啊,请教各位大侠!!!在线等候
比如
SQL> create or replace type Pointype as object (x int,y int);两个坐标