ORACLE存储过程自定义数组与数组赋值

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-31 01:23   21   0
  • 自定义数组

定义数组类型变量 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;

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP