Plsql 使用索引依据、is记录和嵌套表推进嵌套表
你能告诉我为什么这不起作用吗?我想在嵌套表a、b、c上添加一个值 PL/SQLPlsql 使用索引依据、is记录和嵌套表推进嵌套表,plsql,plsqldeveloper,Plsql,Plsqldeveloper,你能告诉我为什么这不起作用吗?我想在嵌套表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; 然
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中的表。怎么了?首先声明一个记录变量。
尝试:
演示:您遇到了什么错误?剩下的代码是什么?
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;
/