开发者

Problem in the result after doing a select in the database

I'm having a problem with the result obtained on a select in my sqlite.

I already have a database fed, and I'm doing queries in my application in adobe air. In my table I have 6 columns:

id | name | email | CITY_ID | state_id | phone

When I do a select of the entire table, it returns me an array of objects.

result[30].id = 30;
result [30]. name = John;
result [30]. email = john@xxx.com;
result [30]. city_id = 1352;
result [30]. state_id = 352;
result [30]. phone = xxxxxxxxx;

All information came right, but the id value is incorrect ( correct is not 30 ) . It seems to me that i'm getting the numerical order and not getting the id column value.

Has anyone had this problem?

UPDATE

My query is:

_selectStat = new SQLStatement();
_selectStat.addEventListener( SQLEvent.RESULT, onDataLoaded );
_selectStat.addEventListener( SQLErrorEvent.ERROR, onSqlError );
_selectStat.sqlConnection = _connection;

var sql:String = 'SELECT * FROM "main"."agencia"';

_selectStat.text = sql;
_selectStat.execute();开发者_JS百科


I'm not familiar with Adobe development or sqlite, so I'm speculating here. If 'id' is a database property, then you may need to indicate that you want the column 'id', and not the property 'id'. There should be a way to do this with the adobe application syntax or the sqlite SQL syntax. In mssql, brackets [] are used for this, so it would be [id] to indicate the column 'id' and not the property. There should be something similar for your environment.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜