您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Oracle的REF的读写方法

2024/4/12 20:28:55发布21次查看
1,创建struct类型 create or replace type struct_test as object (name varchar2(50),title varchar2(30),num number(2)); 2,
1,创建struct类型
create or replace type struct_test as object (name varchar2(50),title varchar2(30),num number(2));
2,创建struct类型的表并插入struct类型数据
create table ref_table of struct_test;
insert into ref_table values(’name’,'title’,1);
3,,创建测试表
create table test (
id number(10,0) not null,
contentr ref struct_test,
constraint test_pk primary key(id));
4,ref类型的数据的插入
insert into test select 1, ref(rt) from ref_table rt
注意:必须采用这种方式插入数据!
5,ref类型的数据的读取
select deref(contentr) as r from test
select deref(contentr).name as r from test
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product