The one object from database. You can not create instance
from DatabaseObject, you should use Data.Database.QueryResult#getFirst QueryResult.getFirst,
Data.Database.QueryResult#getLast QueryResult.getLast or Data.Database.QueryResult#get QueryResult.get,
Example
// Assuming Database and person table already created varselectedPeople = []; // Getting people who older than 15 years old and name begins with A. varselectedPeopleQueryResult = database.query("SELECT * FROM person WHERE(age > 25 AND name LIKE 'A%')"); for(vari = 0; i < selectedPeopleQueryResult.count() ; i++){ // Getting person varselectedPerson = selectedPeopleQueryResult.get(i); selectedPeople.push( { name:selectedPerson.getString('name'), age:selectedPerson.getInteger('age'), isWorker:selectedPerson.getInteger('isWorker'), rate:selectedPerson.getFloat('rate'), } ); }
Since
1.0
The one object from database. You can not create instance from DatabaseObject, you should use Data.Database.QueryResult#getFirst QueryResult.getFirst, Data.Database.QueryResult#getLast QueryResult.getLast or Data.Database.QueryResult#get QueryResult.get,
Example