Search code examples
oracleplsqluser-defined-types

Do I need to add an ID value to my objects?


I have all these nice objects set up and ready to be added to tables. How are the objects made unique when I say:

CREATE TYPE obj_table AS TABLE OF obj_type;

Do I need to create a table that pairs an item with an ID, and declare the ID to be the primary key, or is this somehow done implicitly?


Solution

  • For PL/SQL nested tables (see documentation), the index number is implicit with the definition of the table and assigned as you insert items into your defined table.