日期:2014-05-16  浏览次数:20498 次

数组集合类型 index table2
-- Created on 2010/05/26 by NAN
declare
  -- Local variables here
  i integer;
  TYPE t_test IS TABLE OF VARCHAR2(10 ) INDEX BY VARCHAR2 (10);
  v_test t_test;
  v_test2 t_test;
begin
  -- Test statements here
  FOR i IN 1 .. 10 LOOP
      v_test(i) := i;
  END LOOP;
  v_test2 := v_test;
  v_test2(11) := 'xxx';
  FOR i IN 1 .. v_test2.count LOOP
      dbms_output.put_line(v_test2(i));
  END LOOP;
 
  EXCEPTION
      WHEN OTHERS THEN
           dbms_output.put_line( sqlerrm);
end;