我尝试从sqlStmt显示总和(),但我得到的只是[对象,对象],任何想法如何?
由于
private function displayAmountHeading():void {
sqlStmt = new SQLStatement();
sqlStmt.sqlConnection = sqlConn;
sqlStmt.text = "SELECT SUM(Amount) FROM MainTable";
sqlStmt.execute();
var result:Array = sqlStmt.getResult().data;
if (result != null) trace(result);
}
//return [object, object]
答案 0 :(得分:2)
您正在尝试跟踪数组。如果要查看该数组中的第一个值,请尝试
SELECT SUM(Amount) as sum FROM MainTable
trace(result[0].sum);
答案 1 :(得分:2)