PL/SQL: Arrays Cheat Sheet

Creating a Varray Type
CREATE OR REPLACE TYPE varray_type_name IS VARRAY(n) of <element_type>

Where,

  • varray_type_name is a valid attribute name,
  • n is the number of elements (maximum) in the varray,
  • element_type is the data type of the elements of the array.
Resize the max size of array
CREATE Or REPLACE TYPE PrintArray AS VARRAY(10) OF VARCHAR2(10);
Drop the varray
DROP TYPE varray_type_name ;

Leave a Reply

Your email address will not be published. Required fields are marked *