Home | Previous Page | Next Page   Data Types > Data Type Casting and Conversion >

What Extended Data Types Can Be Cast?

The next table shows the extended data type combinations that you can cast.

Target Type Opaque Type Distinct Type Named ROW Type Unnamed ROW Type Collection Type Built-in Type
Opaque Type Explicit or implicit Explicit Explicit Not Allowed Not Allowed Explicit or implicit3
Distinct Type Explicit3 Explicit Explicit Not Allowed Not Allowed Explicit or implicit
Named ROW Type Explicit3 Explicit Explicit3 Explicit1 Not Allowed Not Allowed
Unnamed ROW Type Not Allowed Not Allowed Explicit1 Implicit1 Not Allowed Not Allowed
Collection Type Not Allowed Not Allowed Not Allowed Not Allowed Explicit2 Not Allowed
Built-in Type Explicit or implicit3 Explicit or implicit Not Allowed Not Allowed Not Allowed System defined (implicit)
1 Applies when two ROW types are structurally equivalent or casts exist to handle data conversions where corresponding field types are not the same.2 Applies when a cast exists to convert between the element types of the respective collection types.3 Applies when a user-defined cast exists to convert between the two data types.

The table shows only whether or not a cast between a source type and a target type are possible. In some cases, you must first create a user-defined cast before you can perform a conversion between two data types. In other cases, the database server provides either an implicit cast or a built-in cast that you must explicitly invoke.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]