DROP TYPE statement DROP TYPE statement SQL statementsDROP TYPE user-defined typesdropping data typesuser-defined

The DROP TYPE statement removes a user-defined type (UDT) that was created using a .

Syntax DROP TYPE [ schemaName. ] SQL92Identifier RESTRICT

The type name is composed of an optional schemaName and a SQL92Identifier. If a schemaName is not provided, the current schema is the default schema. If a qualified type name is specified, the schema name cannot begin with SYS.

The RESTRICT keyword is required. CASCADE semantics are not supported. That is, will not track down and drop orphaned objects.

Dropping a UDT implicitly drops all USAGE privileges that reference it.

You cannot drop a type if it would make another SQL object unusable. This includes the following restrictions:

  • Table columns: No table columns have this UDT.
  • Views: No view definition involves expressions which have this UDT.
  • Constraints: No constraints reference expressions of this UDT.
  • Generated columns: No generated columns reference expressions of this UDT.
  • Routines: No functions or procedures have arguments or return values of this UDT.
  • Table Functions: No table functions return tables with columns of this UDT.
Example DROP TYPE price RESTRICT;