3.7 Managing Types

A type is a user-specified object or collection definition. Use Object Browser to create, view, or drop a type.

Oracle APEX currently only supports collection definitions. There are two categories of Oracle collections (SQL collections):

  • Variable-length arrays (VARRAY types)

  • Nested tables (TABLE types)

VARRAY types are used for one-dimensional arrays, while nested table types are used for single-column tables within an outer table.

See Also:

3.7.1 Creating a Type

Create a type using Object Browser.

To create a collection type:

  1. In Object Browser, click the Create Database Objects menu and select Type.

    Tip:

    To create new objects from the Object Tree, right-click the object and select the Create option.

    The Create Type Wizard appears.

  2. On Create Type:
    1. Type Name - Enter the name of the type.
    2. Set the Collection Type:
      • VArray (variable-size array) - Creates an ordered set of elements, each with the same data type.
      • Nested Table - Creates a named nested table of selected data type.
    3. Limit (VArray only) - Enter the number of elements in the VArray. This value must be a valid positive integer.
    4. Data Type - Specify the data type of the collection elements.
    5. Length - Enter the length of the selected data type. This value must be a valid positive integer.
      This field changes to Object for the configuration "Nested Table, < Nested Object >."
  3. Click Create Type.

3.7.2 Viewing a Type

Select a type from the Object Tree and access tabs in the Object Detail View.

To browse a collection type:

  1. In Object Browser, Object Tree, expand Types and select a type to view.
  2. The Object Detail View appears and displays four tabs:
    • Object Details - Displays details about the selected type. Available actions include:
      • Drop.
      • Refresh
    • Synonyms - Displays a list of synonyms for the current type. Available actions include:Refresh.
    • Grants - Displays a list of grants associated with the type. Grant details include grantee, privilege, and grant options. Available actions include:
      • Grant
      • Revoke
      • Refresh
    • DDL - Displays the DDL necessary to re-create this type. Available actions include:
      • Download.
      • Refresh

3.7.3 Dropping a Type

Select a type from the Object Tree pane and click Drop on the Object Details tab.

To drop a collection type:

  1. In Object Browser, Object Tree, expand Types and select a collection type.

    The Object Detail View appears.

  2. On the Object Details tab, click Drop.
    1. Drop - Review the details.
    2. SQL - Displays the SQL generated to drop the type. To copy the displayed SQL, click the Copy icon.
    3. To confirm your selection, click Drop again.