SELECT * FROM my.table WHERE created_by = '2016-01-02'
Special conversion cases
Teiid Spring Boot automatically converts string literals within a SQL statement to their implied types. This typically occurs in a criteria comparison where an expression with a different datatype is compared to a literal string. For example:
In the preceding example, if the created_by
column has the data type of date,
Teiid Spring Boot automatically converts the data type of the string literal to a date.
Teiid Spring Boot can automatically convert literal strings and numeric type values to Boolean values as shwon in the following table:
Type | Literal value | Boolean value |
---|---|---|
String |
'false' |
false |
'unknown' |
null |
|
other |
true |
|
Numeric |
0 |
false |
other |
true |
Teiid Spring Boot can implicitly convert properly formatted literal strings to their associated date-related data types as shown in the following table:
String literal format | Possible implicit conversion type |
---|---|
yyyy-mm-dd |
DATE |
hh:mm:ss |
TIME |
yyyy-mm-dd[ hh:mm:ss.[fff…]] |
TIMESTAMP |
The preceding formats are those expected by the JDBC date types.
For information about using other formats, see the functions PARSEDATE
, PARSETIME
, and PARSETIMESTAMP
in Date and time functions.