PL/SQL Table Based Records

·

You define and declare records either in the declaration section of a PL/SQL block, or globally, via a package specification. A table-based record is one whose structure is drawn from the list of columns in the table. A table-based record is drawn from a particular table structure.

%TYPE and %ROWTYPE

%TYPE is used to declare a variable that is of the same type as a specified table’s column.

Emp_number emp.empno%type;

%ROWTYPE is used to declare a record i.e. a variable that represents the entire row of a table.

Emp_record emp%rowtype

Another example of Table Based Record

Declare table-based record for employee table.

emp_rec employee%ROWTYPE

Live Traffic Feed

About this blog

Site Sponsors