Monday, November 5, 2018

Record in Oracle

Record gives you a way to store and access values as a group.

  • It is composed of one or more fields, each with its own value.
  • These fields can be of different datatypes. 
  • You can use records to hold related items and pass them to subprograms as a single parameter. 
  • When you are creating a record, you are just creating your own datatype. 


PL/SQL supports three different kinds of records:-

       1. Table-based record (table_name % ROWTYPE):-

Based on a table's column structure.Record will have same number of fields as columns in table and each field in record has the same name as a column in a table

      2. Cursor-based record (cursor_name % ROWTYPE):-

Based on the cursor's SELECT statement.Record will have same number of fields as column or expression in the cursor SELECT statement and each field in record has the same name as column or expression in the cursor SELECT statement.

       3. Programmer-defined record :- 

Based on the structure defined by programmer .Each field is defined explicitly (its name and datatype) in the TYPE statement.

Programmer defined composite records are used when


  • A field of record needs to be a PL/SQL-specific type, such as BOOLEAN, PLS_INTEGER
  • Record type is not dependent on a table or cursor result 
  • You want to have a control on number, name and datatype of fields in a record

No comments:

Post a Comment

SupplierAddressImportTemplate.xlsm South Africa Suburb Field mapping in POZ_SUPPLIER_ADDRESSES_INT

Suburb mpping in Supplier Address Import Template will be mapped to Address Element Attribute2 (HZ_LOCATIONS. ADDR_ELEMENT_ATTRIBUTE2)