Composite data types Are of two types: PL/SQL RECORDS PL/SQL Collections INDEX BY Table Nested Table VARRAY
Contain internal components Are reusable
Creating a PL/SQL Record Syntax:
TYPE type_name IS RECORD(
Field_declaration [,field_declaration]… );
Identifier type_name; mds_gen_org_history 例: declare
type emp_table_type is table of emp%rowtype
index by binary_integer; emp_table emp_table_type; begin
select * into emp_table(6) from EMP WHERE ENAME='ALLEN'; DBMS_OUTPUT.PUT_LINE(EMP_TABLE(6).SALARY); end;
index by table 的例子: declare
type emp_table_type is table of EMP%rowtype
index by binary_integer; emp_table emp_table_type; i pls_integer:=1;
cursor c_emp is select * from emp order by ename; begin
open c_emp; loop
exit when c_emp%notfound; fetch c_emp into emp_table(i); i:=i+1;
搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新人文社科Oracle9i笔记1(16)全文阅读和word下载服务。
相关推荐: