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






A record is a collection of individual fields that represents a row in a table.

These fields are unique and each has its own values.

By using records, you can group like data into one structure and then manipulate this structure as one entity or logical unit.

You declare a record in the declaration portion of a PL/SQL block, subprogram, or package.

SQL>
SQL>
SQL> DECLARE
  2    TYPE hrc_company_rec IS RECORD
  3      (hrc_company_id NUMBER,
  4       product_description VARCHAR2(20),
  5       company_short_name VARCHAR2(30));
  6    v_example_rec hrc_company_rec;
  7  BEGIN
  8    /*Do some processing */
  9    null;
 10  END;
 11  /

PL/SQL procedure successfully completed.

SQL>
SQL>








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