I have done exactly as you mention getting the error
Unable to execute sql-home Object(anonymous function) @ main.js:52598
message: “sqlite3_prepare_v2 failure: no such table: empdetails”
it should have been cordova -v (mine is 6.4.0) but it looks like you have everything up to date.
Did you place your database file on www folder?
Are you sure your database has the table named empdetails? If you’re not sure about this use the SQLite browser to inspect your database files and respective tables.
Yes kept db folder in src folder and also in www folder both tried and am using SQLite browser to create db .i have tried with different set of db and tables no luck
Yeah, I looked at that option. We can use that if we have prepopulated DB. That is, to package the app along with the DB. But in our case, we would download the DB from a server and save it in application or document storage folder(using cordova file transfer plugin) of the app in the device and then access this DB using SQLite plugin.
However, that prompts me another question. Can we download DB from remote server directly into www folder of the app and also can we query the DB from that location using SQLite? As I can see from documentation, SQLite has a ‘location’ property which points to application\documents directory.
What’s the version of your Android’s emulator? Mine is 5.0.0 or 6.0.0 both working with pre-populated database.
Tonight i’ll try to create a template for ionic 2 with a pre-populated database.