The specification is the interface of the object type. It contains declarations of attributes and methods. The specification contains public declarations, which are accessible outside the object type. You can call object methods and attributes using dot notation. In the interface part of object type, you are to declare all attributes before the methods, otherwise PL/SQL compilation error will occur.
If the object type specification has only attributes, it is not necessary to create type body. You can’t declare constants, exceptions, cursors, or types in the object specification. You must declare at least one attribute but less than 1000 ones in the specification.
Attribute name attribute must be unique within the object type.
PL\SQL does not allow creating attributes of such data types:
Generally object method is declared using the keyword MEMBER or STATIC. To call MEMBER methods the instance of this type is to be created. STATIC methods can be invoked on object types when no object of such type exists. Like other subprograms, methods have two parts: a declarative one and a subprogram body. The declarative part consists of the method name, parameter list, and return type(for functions). The body is the code that is executed to perform a specific task.
Specify MAP or ORDER methods to provide the possibility of comparison and sorting of objects.
To delete an object type, right click a required object, and then click Delete in the shortcut menu.