测试中遇到了布尔类型转换的问题,经查看,DB2对布尔类型的支持如下。
Db2 11.1
A Boolean value represents a truth value; that is, TRUE or FALSE. A Boolean expression or predicate can result in a value of unknown, which is represented by the null value.
The following data types can be cast to the BOOLEAN data type:
- CHAR or VARCHAR can be cast to a BOOLEAN value:
- Cast to TRUE: 't' , 'true' , 'y', 'yes' , 'on' ,'1'
- Cast to FALSE: 'f', 'false', 'n', 'no', 'off', '0'
- decimal floating point or binary integer
- When a value of data type DECFLOAT, SMALLINT, INTEGER, or BIGINT is cast to a BOOLEAN value, the result is TRUE if the value is not zero, and FALSE if the value is zero.
Related reference:
Compound SQL (compiled) statement