Use this page to build a CAST expression that converts an instance
of a data type into an instance of a different data type.
A CAST expression has the following form: CAST (expr AS
datatype). The result of the expression expr is
converted to type datatype. For example, CAST (XMLTEST.EMPLOYEE.SALARY
AS INTEGER) converts the values in the column SALARY to type INTEGER.
- CAST
- Select the column that you want to cast. If
you want the result of the cast to be a null value of the specified data type,
select NULL. If you want to denote a cast for a parameter
marker, select ?.
- AS
- Select the data type that you want to convert
the column to.
- Length of data type
- Specify the length (byte count) of the column
for the CHAR, VARCHAR, CLOB, and BLOB data types. For the DECIMAL data type,
specify both the number of digits in the column (precision) and the number
of digits to the right of the decimal point (scale).
- Preview of CAST expression
- Shows the CAST expression that you have created.