Object Type Body

Object type body defines code for object methods. Procedures and functions implementation details are encapsulated in the object body and they are hidden from code outside the object.

Note

Sometimes object body is unnecessary.

Note

You are not allowed to declare attributes in the body, so all items in the object type specification are public (visible outside the object type).

Like package procedures and functions, object type methods can be overloaded. You can create several methods with the same name but with the different parameter set within the object. When calling object subprogram, PL/SQL distinguishes the correct method by comparing actual parameters with the formal ones.

Creating an Object type Body

  1. In the Database Explorer window, expand the User Types folder.
  2. Expand the Object Types folder.
  3. Select a required object, and then click Create Type Body in the shortcut menu.
  4. Fill a template with statements.
  5. Save the object body.

Editing an Object type Body

  1. In the Database Explorer window, expand the User Types folder.
  2. Expand the Object Types folder.
  3. Right click a required type, and then click Open Type in the shortcut menu.