oracle 集合 nested_table

  • Post author:
  • Post category:其他




1、–创建嵌套表类型

Create Or Replace Type nested_table_type_name Is Table Of element_type;

–创建嵌套表对象

nested_table_variabe_name nested_table_type_name;




注:使用嵌套表对象元素之前必须先初始化。下标从1开始,元素个数没限制

实例:

Create Or Replace Type test_type Is Table Of Varchar2(100)

Create Table tmp

(

Id Number,

phone  test_type,

email  test_type

)

Nested Table phone Store As phone_table,

Nested Table email Store As email_table

Insert Into tmp Values(1,test_type(‘13400000001′,’13400000002′,’13400000003’),test_type(‘a@126.com’,’b@126.com’));

Insert Into tmp Values(2,test_type(‘13500000001′,’13500000002′,’13500000003’),test_type(‘a@163.com’,’b@163.c



版权声明:本文为csdn1284934570原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。