Name

CREATE/DROP TYPE BODY

Synopsis

CREATE Syntax:

CREATE [OR REPLACE] TYPE BODY [schema.]type_name
{IS | AS} {MEMBER | STATIC} {procedure_spec | function_spec}
[{MEMBER | STATIC} {procedure_spec | function_spec} ...]
[, {MAP | ORDER} MEMBER function_spec]
END

DROP Syntax:

DROP TYPE BODY [schema.]type_name

Creates or removes a type body.

Note that there is no ALTER TYPE BODY statement. However, if you DROP a type body, the corresponding object type declaration will still exist, and you can issue a new CREATE TYPE BODY statement to create a new, and possibly different, type body.

Keywords

type_name

Name of the object type to which this type body corresponds.

MEMBER

Specifies that a function or procedure is associated with the object type that is referenced in an attribute. This class of method has an implicit first parameter referenced as SELF.

STATIC

Specifies that a function or procedure is associated with the object type that is referenced in an attribute, but has no implicit parameters.

procedure_spec

Specification for a procedure. See Chapter 9 for details.

function_spec

Specification for a function. See Chapter 9 for details.

MAP MEMBER function_spec

Specifies a member function that returns the relative position of a given instance in the ordering of all instances of the object.

ORDER MEMBER function_spec

Specifies a member function that takes an instance of an object as an explicit argument and the implicit SELF argument and returns -1, 0, or a positive integer.

Common keywords and clauses: ...

Get Oracle in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.