node.js - Sqlite nodejs - Queries with multiple parameters -


here sample request possible sqlite3 :

  var stmt = db.prepare("insert lorem values (?)");   (var = 0; < 10; i++) {       stmt.run("ipsum " + i);   }   stmt.finalize(); 

is possible pass different parameters in query ?

"insert ? (?) values (?)" 

here request optimize :

var req = 'insert ' + nametable + ' (';  (var cle in ligne) {     req += cle + ', '; } substring(1,req.lenght-2);  req += ') values ('  (var cle in ligne) {     req += ligne[cle] + ', '; } substring(1,req.lenght-2); // on supprime la virgule de la fin req += ');'; 

you can't; query parameters expressions , can't used identifiers.

unless you're writing generic database tool, however, sign of bad design. means need merge tables , add columns values you're trying use table names.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -