你能告诉我为什么这不起作用吗?我想在嵌套表a,b,c
上添加一个值PL / SQL
TYPE chars is table of varchar2(30);
TYPE numbers is table of number;
TYPE t_content IS RECORD(a numbers, b chars, c chars);
TYPE t_table IS table of t_content index by varchar2(30);
v_information t_table;
然后在声明中
v_information ('Index1').a:= numbers();
我无法使用带索引值的表访问a,b,c中的表。怎么了?
答案 0 :(得分:0)
首先声明一个记录变量。
尝试:
DECLARE
TYPE chars is table of varchar2(30) ;
TYPE numbers is table of number ;
TYPE t_content IS RECORD(a numbers, b chars, c chars) ;
TYPE t_table IS table of t_content index by varchar2(30) ;
v_information t_table;
my_record t_content;
BEGIN
my_record.a := numbers( 1,2,3,4 );
my_record.b := chars('a','b','c');
my_record.c := chars('x','y','z');
v_information('Index1') := my_record;
my_record.a := numbers( 22,44 );
my_record.b := chars('aa','bb','cc');
my_record.c := chars('x','y');
v_information('Index2') := my_record;
END;
/
演示: