Skip to main content

Data Types Handling

Dozer natively supports these data types.

Explicit and Implicit Casting

It is possible to explicitly cast between primitive types using the CAST() function.

CAST(value AS [UINT | INT | FLOAT | DECIMAL | BOOLEAN | STRING | TEXT | TIMESTAMP | DATE)

However, DozerSQL automatically tries to cast between data types when a function is invoked with incompatible argument types. The following tables explains how types can be casted between each other

Target TypeCan be casted from type
UINTINT, STRING, NULL (defaults to 0)
INTUINT, STRING, NULL (defaults to 0)
FLOATDECIMAL, UINT, INT, NULL (defaults to 0.0)
DECIMALFLOAT, UINT, INT, NULL (defaults to 0.0)
BOOLEANINT, UINT, FLOAT, DECIAML, NULL
For all values 0 defaults to FALSE, any other number defaults to TRUE
STRINGTEXT, UINT, INT, FLOAT, DECIMAL, BOOLEAN, DATE, TIMESTAMP, BINARY, NULL
TEXTSTRING, UINT, INT, FLOAT, DECIMAL, BOOLEAN, DATE, TIMESTAMP, BINARY, NULL
TIMESTAMPSTRING (using RFC3339 format)
DATESTRING (using RFC3339 format)