Home | Previous Page | Next Page   Object-Relational Databases > Creating and Using User-Defined Casts in Dynamic Server >

Casting Row Types

You can compare or substitute between values of any two row types (named or unnamed) only when both row types have the same number of fields, and one of the following conditions is also true:

If a built-in cast exists to handle data conversions on the individual fields, you can explicitly cast the value of one row type to the other row type (unless the row types are both unnamed row types, in which case an explicit cast is not necessary).

If a built-in cast does not exist to handle field conversions, you can create a user-defined cast to handle the field conversions. The cast can be either implicit or explicit.

In general, when a row type is cast to another row type, the individual field conversions might be handled with explicit or implicit casts. When the conversion between corresponding fields requires an explicit cast, the value of the field that is cast must match the value of the corresponding field exactly, because the database server applies no additional implicit casts on a value that has been explicitly cast.

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