作者:jrs2078148 | 来源:互联网 | 2014-07-08 01:11
OraclePLSQL示例1Sql代码www.2cto.com--Createdon2010/04/16byNANdeclare--Localvariablesherec_tobecom.cRef;TYPEt_tableISTABLEOFkbis.k002%TYPE;v_...S
Sql代码 www.2cto.com
-- Created on 2010/04/16 by NAN
declare
-- Local variables here
c_tobe com.cRef;
TYPE t_table IS TABLE OF kbis.k002% TYPE;
v_t_table t_table;
begin
-- Test statements here
SELECT t.k002 BULK COLLECT INTO v_t_table FROM kbis t; --取出所有数据
FOR i IN 1 .. v_t_table.COUNT LOOP
dbms_output.put_line(v_t_table(i));
END LOOP;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line( Sqlerrm);
end;