Search code examples
javaoracleoopplsqlobject-type

Nested class (Object Type) in PL/SQL


In Java it's possible to define recursive(nested) class like:

private class Node
{
  Item item;
  Node next;
}

Is it possible to create similar structure using PL/SQL Object Types?


Solution

  • There's no such option,

    But according to Oracle docs about Nested Object Types, you should use Collection to hold same types (without recursion)

    Collection types are object data types for modeling multi-valued attributes. Nested tables are collection types

    For example:

    describe dm_nested_categoricals
    DM_NESTED_CATEGORICALS TABLE OF SYS.DM_NESTED_CATEGORICAL