Create casts

A cast is a conversion from one data type to another. The cast accepts the source data type as its argument and returns the target data type.

The following table describes the properties you specify when you create a cast.
Table 1. Properties for creating a cast
Property Default value Description
Cast from type None The source data type.

See Source and target data types for more information.

Cast to type None The target data type. The source and target data types cannot both be built-in or qualified types.

See Source and target data types for more information.

Implicit cast Yes The type of cast. Implicit casts are automatically called by the database server. Explicit casts are called by the users.

See Implicit and explicit casts for more information.

Support routine Yes (typeCast) If the source and target data types do not have the same binary representation, you must write a routine to support the cast.

See Cast support functions for more information.

Language (if you choose to create a support function) C Which language to use for the cast support function: C or Java™.

You must set server compatibility to 9.2 or later to generate code for Java projects.

You need the J/Foundation upgrade to HCL OneDB™ to enable Java services.

See the HCL OneDB Guide to SQL: Tutorial for general information about casts.

The following sections describe properties of casts.