完整代码:
call connect on clearsql;
sqlcommand = "select sum(distinct gedimai.gedimo_salinimo_vidkaina) as suma, count(distinct gedimai.gedimo_salinimo_vidkaina) as kiekis from atveju_simptomai left join gedimai_simptomai on gedimai_simptomai.simptomo_id = atveju_simptomai.simptomo_id left join gedimai on gedimai.id = gedimai_simptomai.gedimo_id where atveju_simptomai.atvejo_id = '8'";
set results to the outcome of executeQuery on clearsql using sqlcommand.
set resultAvailable to the outcome of next on results.
print(String.valueOf(results.getInt("suma")));
print(results.getString("suma"));
objectResults.kaina_viso = results.getString("suma");
set resultAvailable to false.
call disconnect on clearsql;
print(results.getString("suma")) 没问题 - 打印到屏幕 '185.0',但 objectResults.kaina_viso = results.getString("suma") 给出错误。
objectResults.kaina_viso 是字符串类型。结果是 DebResultSet
com.blazesoft.engines.rules.NdEvaluationException:调用“getString”失败[Microsoft][SQL Server 的 ODBC 驱动程序 11]在函数 getPriceQty 中评估“results.getString(“suma”)”时描述符索引无效