informix
Informix Guide to SQL: Syntax
SQL Statements

DROP CAST

Use the DROP CAST statement to remove a previously defined cast from the database.

Syntax

Element Purpose Restrictions Syntax
source_type Data type on which the cast operates The type must exist at the time the cast is dropped. Data Type, p. 4-53
target_type Data type that results when the cast is invoked The type must exist at the time the cast is dropped. Data Type, p. 4-53

Usage

You must be the owner of the cast or have the DBA privilege to use the DROP CAST statement.

What Happens When You Drop a Cast

When you drop a cast, the cast definition is removed from the database. Once you drop a cast, it cannot be invoked either explicitly or implicitly. Dropping a cast has no effect on the user-defined function associated with the cast. Use the DROP FUNCTION statement to remove the user-defined function from the database.

Warning: Do not drop the built-in casts, which are owned by user informix. The database server uses built-in casts for automatic conversions between built-in data types.

A cast that is defined on a particular data type can also be used on any distinct types created from that type. When you drop the cast, you can no longer invoke it for the distinct types. Dropping a cast that is defined for a distinct type has no effect on casts for its source type.

When you create a distinct type, the database server automatically defines an explicit cast from the distinct type to its source type and another explicit cast from the source type to the distinct type. When you drop the distinct type, the database server automatically drops these two casts.

Related Information

Related statements: CREATE CAST and DROP FUNCTION

For more information about data types, refer to the Informix Guide to SQL: Reference.


Informix Guide to SQL: Syntax, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved