Collections and Records

A PL/SQL collection is an ordered group of elements like lists, arrays, and other datatypes.
Each element of the collection has a unique index that determines its position.

PL/SQL collection types:

Collection Methods:

  • EXISTS
  • COUNT
  • LIMIT
  • FIRST
  • LAST
  • PRIOR
  • NEXT
  • EXTEND
  • TRIM
  • DELETE

Collection Exceptions:

  • COLLECTION_IS_NULL
  • NO_DATA_FOUND
  • SUBSCRIPT_BEYOND_COUNT
  • SUBSCRIPT_OUTSIDE_LIMIT
  • VALUE_ERROR

A PL/SQL record is a group of elements stored in fields, each field having its own name and datatype.
TYPE type_name IS RECORD (field_declaration[,field_declaration]…);

PL/SQL can handle the following types of records: