读书人

oracle数组运用笔记

发布时间: 2013-09-08 15:21:21 作者: rapoo

oracle数组使用笔记
CREATE OR REPLACE Type dev_test Is Object(
c_Rcpt_No Nvarchar2(50), --收据号
c_clm_no Nvarchar2(100)
)

--使用1
declare
testObj dev_test;
begin

testObj := dev_test('888', '9999');
dbms_output.put_line(testObj.c_Rcpt_No);

exception
when others then
dbms_output.put_line(sqlcode || sqlerrm);
end;


--使用2
declare
Type tt Is Table Of dev_test;
testObj tt;
begin

testObj := tt();
testObj.Extend(1);
testObj(1) := new dev_test('12', '43');

dbms_output.put_line(testObj(1).c_Rcpt_No);
exception
when others then
dbms_output.put_line(sqlcode || sqlerrm);
end;

读书人网 >其他数据库

热点推荐