作者:yjlz2012 | 来源:互联网 | 2014-07-08 01:11
Oracle数组集合类型indextable2Sql代码www.2cto.com--Createdon2010/05/26byNANdeclare--Localvariableshereiinteger;TYPEt_testISTABLEOFVARCHAR2(10)I...Syn
Sql代码 www.2cto.com
-- 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;