- 自定义数组
定义数组类型变量 arr_type
type arr_type is table of NUMBER(20);
声明数组变量 arr_val
arr_val arr_type;
- 数组赋值
数组赋值(bulk collect into关键字是将查询结果封装成集合)
select a bulk collect into arr_val from mytable;
- 数组取值
数组取值
for i in 1 .. arr_val.count loop
--处理逻辑
arr_val(i);
end loop;