如何将布尔列与布尔文字进行比较?
ColdFusion Query of Queries 用户指南声称支持布尔文字的比较。
测试条件
此条件测试布尔表达式是 True、False 还是 Unknown。句法
cond_test ::= 表达式 [IS [NOT] {TRUE | 错误 | 未知}]
但是,在 ColdFusion 9.0.1 中,此代码
<cfscript>
rs = QueryNew('a', 'Bit');
QueryAddRow(rs);
rs.a[1] = true;
</cfscript>
<cfquery name="rs2" dbtype="query">
select * from rs where a IS TRUE;
</cfquery>
产生以下错误
java.sql.SQLException: <br><b>Query Of Queries syntax error.</b><br>
Encountered "a IS TRUE.
Incorrect conditional expression,
Expected one of [like|null|between|in|comparison] condition,
at coldfusion.sql.imq.jdbcStatement.parseSQL(jdbcStatement.java:566)
at coldfusion.sql.imq.jdbcStatement.fetchResult(jdbcStatement.java:536)
at coldfusion.sql.imq.jdbcStatement.execute(jdbcStatement.java:131)
at coldfusion.sql.Executive.executeQuery(Executive.java:1374)
at coldfusion.sql.SqlImpl.execute(SqlImpl.java:345)
at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:915)
at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:590)
at cfqoq2ecfm1569474275.runPage(/Users/jared/git/pf/tafkan/test/temp/qoq.cfm:6)
我找到了一个丑陋的解决方法(未显示),但如果有更清洁的方法,我想知道。