Coldfusion 使用cfscript创建的查询的cfoutput

Coldfusion 使用cfscript创建的查询的cfoutput,coldfusion,cfml,Coldfusion,Cfml,我试图赶上cfscript语法,所以晚会迟到了。我在cfscript中创建了一个简单的查询,可以很好地执行和转储正确的数据: qPositive = new Query(datasource="#APPLICATION.DSN#"); qPositive.setSQL(" my sql here "); qPositive.addParam(name="xid",value="178",CFSQLTYPE="CF_SQL_INT"); qryPositive = qPositive.execut

我试图赶上cfscript语法,所以晚会迟到了。我在cfscript中创建了一个简单的查询,可以很好地执行和转储正确的数据:

qPositive = new Query(datasource="#APPLICATION.DSN#");
qPositive.setSQL(" my sql here ");
qPositive.addParam(name="xid",value="178",CFSQLTYPE="CF_SQL_INT");
qryPositive = qPositive.execute();  
writeDump(qryPositive.getResult());
这正是我所期望的。但是,在实际页面中

<cfoutput query="qryPositive">

抛出未定义的错误

execute()之后添加
getResult()


您使用的是什么版本的ColdFusion
new Query
在较新版本中已被替换为
QueryExecute()
正如您在下面所说的,您必须使用
getResult()
才能使查询结果实际存在。由于这些是可链接的,我通常只会自动链接
x.execute().getResult()
。我认为
execute()
本身不会为您提供很多信息。
qryPositive = qPositive.execute().getResult();