Record Variables Based on Tables : RECORD « PL SQL Data Types « Oracle PL/SQL Tutorial






A record type variable based on a table means that each field in the record has the exact same name and datatype as the columns in the specified table.

The %rowtype attribute is used to define a record based on a table.

The %rowtype is similar to the %type.

The %type refers to only a single variable.

The %rowtype refers to an entire table row.

TYPE emp_sales_rec is record
(id       INTEGER,
 name      VARCHAR2(32),
 rate      employee.salary%type);








21.30.RECORD
21.30.1.Records
21.30.2.Accessing Individual Record elements
21.30.3.Accessing an entire record
21.30.4.Testing for equality of records
21.30.5.Record Variables Based on Tables
21.30.6.Record Variables
21.30.7.Create Record based on table column type
21.30.8.Implicit Declaration
21.30.9.Assigning Record Variables
21.30.10.Using the Record Datatype and its limitation
21.30.11.Records based on tables can also be used in a SELECT statement
21.30.12.Inserts and updates using record variables
21.30.13.Using Records with 'select into'
21.30.14.Retrieving Cursor Variables with a Record Variable
21.30.15.Looping through Records in a Cursor
21.30.16.Looping through multiple records
21.30.17.Perform a field-by-field comparison
21.30.18.Passing Variables without Copying