Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Table not found in classic project.

$
0
0

I have made a table using sqlitebrowser and copied it into resources folder of my project. But my insert query is giving me this error: "[ERROR] : TiDB: (KrollRuntimeThread) [5,46023] Error executing sql: no such table: barcode (code 1): , while compiling: INSERT INTO barcode (id,type) VALUES (?,?)"

here is my code: var db = Ti.Database.install('../scanner.sqlite','barcode'); db.close(); var db = Ti.Database.open('barcode');

function init(){ db.execute('DROP TABLE IF EXISTS barcode'); db.execute('CREATE TABLE IF NOT EXISTS barcode (id REAL PRIMARY KEY, type TEXT)');

};

exports.insertIntoDB = function(data){ Ti.API.info("yo"); db.execute('INSERT INTO barcode (id,type) VALUES (?,?)', data.data,data.type);

};


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>