declare了一个变量a='{1:[2,3,4],2:[3,4]}'
a变量可以看成是一个map,key为1的value是2,3,4
我想让key为1的value后面加一个5,变成a='{1:[2,3,4,5],2:[3,4]}'在存储过程里应该怎么写呢,写不出哥今天就不用下班了,急求啊!!!

解决方案 »

  1.   

    简单点就是二维数组:
    declare
      type ta_int_a is table of integer;
      type ta_int_b is table of ta_int_a;
      va ta_int_b:=ta_int_b(ta_int_a(2,3,4),ta_int_a(8,10,1));
      i int;
      j int;
    begin
      for i in 1..va.count loop
        dbms_output.put_line('This is the :'||i||' row1--------------');
        for j in 1..va(i).count loop
           dbms_output.put_line(va(i)(j));
        end loop;
      
      end loop;
    end;This is the :1 row1--------------
    2
    3
    4
    This is the :2 row1--------------
    8
    10
    1