完整的错误详细信息是什么?它是专门指向查询,还是仅仅指向查询附近的一条线,这导致您假设查询有问题。
(到目前为止,您发布的内容中没有任何内容表明这是一个查询问题。)
在任何情况下,您的查询目前都可能受到 SQL 注入,应更改为:
select *
from table1, table2
where table1.u_construct_id (+)= table2.u_construct_id
and table1.LOCATION_ID = <cfqueryparam value="#url.locationId#" cfsqltype="cf_sql_integer" />
and table1.OPERATOR_ID = <cfqueryparam value="#url.operatorId#" cfsqltype="cf_sql_integer" />
请注意,除了 cfqueryparam(通常应用于所有动态变量,尤其是客户端提供的变量)之外,这两个变量已被确定url
范围,并且很可能正确地确定变量的范围是解决方法(如果 locationId 或 operatorId存在于其他范围内,作为非简单变量)。