Sunday, 25 August 2013

Make operation with aggregate function result

Make operation with aggregate function result

I confess that I do not get along very well with the Deferred object. I'm
making a query to the database on several "Stores" and as a result I want
to do a series of operations. This troubles me because the results are
returned asynchronously and I have no way to perform the corresponding
operation on the "store" you should. In short, the problem is that this
piece of code always executes the same function on the same "Store"
for (var i = 0; i < schema['stores'].length; i++) {
storeName = schema['stores'][i].name;
var objeto = db.executeSql('SELECT MAX(date_upd) FROM ' + '"' +
storeName + '"').done(
function(result, a){
//saveDataSynce(db, storeName, result);
console.log(result);
}
);
}

No comments:

Post a Comment