create type obj as object
(
val1 varchar2(20),
val2 varchar2(20),
val3 char(1));
/就可以了,
使用的时候:
create table test(
id number(10) not null,
name obj
);
/
(
val1 varchar2(20),
val2 varchar2(20),
val3 char(1));
/就可以了,
使用的时候:
create table test(
id number(10) not null,
name obj
);
/
解决方案 »
- oracle 9i http服务占用了tomcat 80端口问题
- 同一个表,几个条件查询的方法
- roacle order by问题
- select * from table1 t?t是怎么来的
- IMP 导出异常问题
- 弱弱的问句!~查询oracle中所有数据库的名字,请大哥给写个sql..小弟实在是想不起来了.
- 请问 oracle 中有没有根据经度,纬度算距离的函数?
- 求sql语句
- insert into tele_success select * from tele_success1; 提示出错
- 菜鸟,求大牛帮助
- oracle 字段类型问题 100分
- 通过培训学unix oracle好吗?请教!在北京,哪的培训机构比较好!
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 /
Function created.
SQL> commit;
Commit complete.