集合 -- 嵌套表

嵌套表(nested table) :嵌套表是对索引表的扩展,嵌套表可以存储到Oracle数据库表中,而索引表仅仅只是内存表

  使用嵌套表是,必须首先使用构造语法初始化嵌套表

  嵌套表没有 index by 子句,下表必须为有序类型,不可以为负数,只能从1开始。

语法: TYPE   type_name   IS  TABLE  OF  element_type [ NOT NULL ];

使用嵌套表的三个步骤:

(1)定义: type deptno_table is table of number(2);

(2)声明:deptno_info  deptno_table;

(3)初始化: deptno_info  := deptno_table(1,2);

原文地址:https://www.cnblogs.com/ly01/p/8547974.html