oracle bulk collect for in

来源:互联网 发布:pb网络用语 编辑:程序博客网 时间:2024/06/04 20:01

declare

 --定义表类型

  type g_table is table of GPRS270_201311%rowtype index by pls_integer;

 --声明数组

  g_datas g_table;
begin

  --批量查询

  select * bulk collect into g_datas from GPRS270_201311;

--数组大小

  dbms_output.put_line(g_datas.count);

--循环输出

  for i in 1 .. g_datas.count loop
    dbms_output.put_line(g_datas(i).telnum);
  end loop;
end;
0 0
原创粉丝点击