I have PhoneGap app running in Android. When the app starts, it inserts approximately 500 rows into SQL. Table has 10 columns. It\'s not a lot of data, I have a JSON in text
Maybe you need a recursive callback function like this:
//too many insert statements
var sqlits= ["INSERT INTO ...", .. .. .. ,"INSERT INTO ..."];
function populate(){
db.transaction(function(tx){
if(sqlits.length > 0){
sql=sqlits.shift();
tx.executeSql(sql);
}else{
alert('End');
}
return true;
},function(tx,err){
console.log("SQL Error: "+err);
},populate);
};
populate();