作者:手机用户2502870065 | 来源:互联网 | 2014-07-08 01:11
Oracle数组集合类型indextableSql代码www.2cto.com--Createdon2010/05/18byNANdeclare--Localvariableshereiinteger;TYPEt_tableISTABLEOFVARCHAR2(20)I...Syn
Sql代码 www.2cto.com
-- Created on 2010/05/18 by NAN
declare
-- Local variables here
i integer;
TYPE t_table IS TABLE OF VARCHAR2(20 ) INDEX BY VARCHAR2 (20);
v_table t_table;
v_str VARCHAR2( 20);
BEGIN
v_table('a') := 'aa';
v_table('b') := 'bb';
v_str := v_table.first;
WHILE v_str IS NOT NULL LOOP
dbms_output.put_line(v_table(v_str));
v_str := v_table.next(v_str);
END LOOP;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line( sqlerrm);
end;