Use of IS TABLE of Oracle

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.