Here is a sample request that it is possible to do with sqlite3 :
var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
for (var i = 0; i < 10; i++) {
stmt.run("Ipsum " + i);
}
stmt.finalize();
Is it possible to pass different parameters in the query ?
"INSERT INTO ? (?) VALUES (?)"
Here is my request to optimize :
var req = 'INSERT INTO ' + nameTable + ' (';
for (var cle in ligne) {
req += cle + ', ';
}
substring(1,req.lenght-2);
req += ') VALUES ('
for (var cle in ligne) {
req += ligne[cle] + ', ';
}
substring(1,req.lenght-2); // On supprime la virgule de la fin
req += ');';
Aucun commentaire:
Enregistrer un commentaire