% Rowtype in Oracle

Source: Internet
Author: User

% Rowtype in Oracle:

 

% Rowtype: indicates that this type is the row data type. It is stored as a row of data. A row has many columns, which is equivalent to a row of data in the table or a row of data in the cursor.

 

% Rowtype is used to query the entire row (select * from EMP;), so the efficiency is faster than that of each field.

 

For example: v_info EMP % rowtype; // This type is the data type of a row in the EMP table.

V_cinfo c_emp % rowtype // This type is the data type of a row in the c_emp cursor.

 

The following is an example:

Declare

R_emp EMP % rowtype; -- this type is the type of a row in the EMP table.
Cursor c_emp is select * from EMP;
Begin
Open c_emp;
Loop
Fetch c_emp into r_emp; -- the into row queried in the cursor is included in the defined variable r_emp.
Exit when c_emp % notfound;
Dbms_output.put_line ('employee name: '| r_emp.ename );
End loop;
Close c_emp;
End;

Related Article

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.