开始
--INDEX BY Table SET SERVEROUTPUT ON; DECLARE TYPE enm_tab_type IS TABLE OF emp%ROWTYPE INDEX BY BINARY_INTEGER; enm_table enm_tab_type; BEGIN SELECT * INTO enm_table(1) FROM emp WHERE empno=7900; SELECT * INTO enm_table(2) FROM emp WHERE empno=7902; END; /
要注意的是:select * into enm_table 是不被允许的。那是因为:select 动作一次只能传递一条记录。
结束