It seems that it is only possible to CAST() from/to boolean as char/varchar (values 'TRUE' and 'FALSE'), and the same also applies to the new SET BIND OF BOOLEAN TO type-to.
Is this restricted by the SQL standard? Wouldn't it also make sense to be able to cast /set bind of booleans to any numeric type as 0 (false) and 1 (true)? Or maybe even the often used Y/N char(1)? Also this error message is now quite confusing: SQL> select cast(true as smallint) from rdb$database; CAST ======= Statement failed, SQLSTATE = 22018 conversion error from string "BOOLEAN"
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel