My js script to 'listTables' is working on the first collection(table) but not on the second.
Here is the script and screen shots. Please advise how I get 'DocsColl' table to populate.
var db = window.openDatabase("Meds_DB", "", "Meds_DB", 1024*1000);
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS "MedsColl"(_objectId TEXT, RxName TEXT, Dose TEXT, Freq_Num TEXT, Freq_Per TEXT, RxNum TEXT, Pharmacy TEXT, PharmNum TEXT, Notes TEXT, StoreNum TEXT, _createdAt DATETIME, updatedAt DATETIME)', []);
tx.executeSql('SELECT * FROM "MedsColl" WHERE "objectId" = "' + value.id + '"', [], function(tx, results){
console.log('rows :' + results.rows.length);
if (results.rows.length == 0){
console.log('Go and add table ' + value.number);
tx.executeSql('INSERT INTO "MedsColl" (objectId, RxName, Dose, Freq_Num, Freq_Per, RxNum, Pharmacy, PharmNum, Notes, StoreNum, _createdAt, updatedAt) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', [value.id, value.RxName, value.Dose, value.Freq_Num, value.Freq_Per, value.RxNum, value.Pharmacy, value.PharmNum, value.Notes, value.StoreNum, value.createdAt, value.updatedAt]);
}
});
});
return;