mercredi 6 avril 2016

how to perform retrieval of data from sqlite db without callback function

Can i retrieve data from sqlite database without callback?

I need something like this but it is not working

var querwy = "SELECT * FROM stock"
var result=$cordovaSQLite.execute(db, querwy, []);
aler(result.rows.item(0).name);

instead of this which is working

var querwy = "SELECT * FROM stock"
$cordovaSQLite.execute(db, querwy, []).then(function(result){;
aler(result.rows.item(0).name);
},function(error){alert('error');}
);

Please i really need to remove the callback function.

Thank you for your time

Aucun commentaire:

Enregistrer un commentaire