oracle multilevel collection-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 3977567
  • 博文数量: 536
  • 博客积分: 10470
  • 博客等级: 上将
  • 技术积分: 4825
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-26 14:08
文章分类

全部博文(536)

文章存档

2024年(3)

2021年(1)

2019年(1)

2017年(1)

2016年(2)

2013年(2)

2012年(10)

2011年(43)

2010年(10)

2009年(17)

2008年(121)

2007年(252)

2006年(73)

相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: oracle

2007-03-23 16:24:51

create or replace procedure test_procproc4(t in number) as
  type t_int is varray(10) of number;
  type t_mint is varray(10) of t_int;
  type t_tab is table of varchar2(50);
  type t_mtab is table of t_tab;
  type t_itab is table of t_int;
  sint t_int := t_int(12);
  smint t_mint := t_mint(sint); stab t_tab; smtab t_mtab; sitab t_itab;
  tc integer := 10; tr integer := 9;
begin
  sint := t_int();
  stab := t_tab();
  smint := t_mint();
  smtab := t_mtab();
  sitab := t_itab();

  sint.extend(tc);
  stab.extend(tc);
  smint.extend(tc);
  smtab.extend(tc);
  sitab.extend(tc);

  for i in 1 .. tc loop
    sint(i) := 9;
    stab(i) := '#@!tsadf2030071546';

    smint(i) := t_int();
    smtab(i) := t_tab();
    sitab(i) := t_int();
    smint(i).extend(tr);
    smtab(i).extend(tr);
    sitab(i).extend(tr);
    for j in 1 .. tr loop
      smint(i)(j) := 995;
      smtab(i)(j) := 'easf';
      sitab(i)(j) := 2868;
    end loop;
  end loop;
  for i in 1 .. tc loop
    execute immediate 'insert into test_4sp.test_proc(col_0)
      values(:1)'
using sint(1)t;
  end loop;
end;
/


increasing the size of a collection (extend method)

to increase the size of a nested table or varray, use extend.
this procedure has three forms:
     extend appends one null element to a collection.
     extend(n) appends n null elements to a collection.
     extend(n,i) appends n copies of the ith element to a collection.
  you cannot use extend with index-by tables. you cannot use extend to add elements to an uninitialized collection. if you impose the not null constraint on a table or varray type, you cannot apply the first two forms of extend to collections of that type.
  extend operates on the internal size of a collection, which includes any deleted elements. this refers to deleted elements after using delete(n), but not delete without parameters which completely removes all elements. if extend encounters deleted elements, it includes them in its tally. pl/sql keeps placeholders for deleted elements, so that you can re-create them by assigning new values.
阅读(1605) | 评论(0) | 转发(0) |
0

上一篇:oracle ora-25153

下一篇:如何撰写商业计划

给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图