% 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;