Create a user-defined cast

You create a user-defined cast with the CREATE CAST statement, which registers the cast in the syscasts system catalog table. The person who registers a cast with CREATE CAST owns the cast.

For information about the syntax of the CREATE CAST statement, refer to the HCL OneDB™ Guide to SQL: Syntax. For a general discussion of using casts, refer to the HCL OneDB Database Design and Implementation Guide.

The CREATE CAST statement provides the following information about the cast to the database server:
  • The kind of user-defined cast to create
  • The cast mechanism that the database server is to use to perform the data conversion
  • The direction of the cast

    The CREATE CAST statement specifies the source and target data types to determine the direction of the cast. For full data conversion between two data types, you must define one cast in each direction of the conversion.