'sqllite offline in ionic 4
I am facing issue in ionic 4 . Induction variable gives undefined but there is data when i run sql query ..Help me Please
following is my code
try {
let induction= await this.sql.dbInstance.executeSql('Select * FROM SurveyResponse where ADDData != ""')
.then(async res => {
let severity = [];
for (var i = 0; i < res.rows.length; i++) {
severity.push(res.rows.item(i));
alert("loop");
alert(induction);
}
var loc= severity;
return await loc;
})
.catch(e=>{
console.log(e);
})
return new Promise((resolve) => {
alert("Induction");
alert(induction);
let obj = { Success: true, result: induction };
resolve(obj);
});
} catch (error) {
alert("error");;
alert(error);
}
Help Me Please
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|