is Table of: Specifies the array type of the table that is a collection , which is simply a data type that can store a column of multiple rows.
Index by Binary_integer: refers to an indexed organization type
BULK COLLECT : Refers to a batch aggregation type , simply , it can store a multi-row multi-column storage type, with BULK COLLECT can load the query results into the collection at once.
"Instance" in the SCOTT mode, use is TABLE for all employee names, job titles, payroll information.
Declaretype Type_ename is Table ofEmp.ename%type; Type Type_job is Table ofEmp.job%type; Type Type_sal is Table ofEmp.sal%type; Var_ename Type_ename:=Type_ename (); Var_job Type_job:=Type_job (); Var_sal type_sal:=type_sal (); begin SelectEname,job,salBulkCollect intoVar_ename,var_job,var_sal fromEMP; /*Output Employee Information*/ forV_indexinchvar_ename.first. Var_ename.last Loop Dbms_output.put_line ('Employee Name:'||Var_ename (V_index)||'Job Title:'||Var_job (V_index)||'Salary:'||var_sal (V_index)); EndLoop; End;
"Instance" in the SCOTT mode, use is TABLE to get all the information for all employees.
Declaretype Emp_table_type is Table ofEmp%RowTypeIndex byBinary_integer; Var_emp_table Emp_table_type; begin Select * BulkCollect intovar_emp_table fromEMP; /*Output Employee Information*/ forIinch 1.. Var_emp_table.COUNTLoop Dbms_output.put_line ('Employee Name:'||Var_emp_table (i). ename||'Job Title:'||Var_emp_table (i). Job||'Salary:'||var_emp_table (i). Sal); EndLoop; End;
Use of IS TABLE of Oracle