Type Conversion Functions
This section describes type conversion functions, including their syntax, parameters, and usage examples.
Function List
Function | Description |
|---|---|
Converts a value from one data type to another and provides the data type to dynamic parameters. |
cast
This function converts a value from one data type to another and provides the data type to dynamic parameters.
The cast expressions can be used wherever expressions are allowed.
Syntax: CAST(Expression as Datatype)
Parameter | Description | Type | Mandatory |
|---|---|---|---|
expression | Source type of the expression. | Any | Yes |
Datatype | Target type. | SQL data type, such as bigint, varchar, double, double precision, boolean, timestamp, decimal, integer, char, or date | Yes |
Index Data Type | SQL Data Type |
|---|---|
Long | Bigint |
String | Varchar |
Float | Double or double precision |
Return value type: target data type
Example: select cast(time as date)
Type | Query Statement | Returned Result |
|---|---|---|
Scenario | cast(time as date) | 2023-08-31 23:11:17.000 |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.

