Stack Exchange
Node js conn.query filter parameters
How can i have a filter criteria in conn.query as below:
I have a variable 
var acc = '123456789';

How can I add this variable as a filter criteria in below query
conn.query("SELECT Id,Body,Name FROM Attachment where ParentID = " + acc, function(err, result) {
    if (err) { return console.error(err); }
    console.log("records ? : " + result.records);
    console.log("total : " + result.totalSize);
    console.log("fetched : " + result.records.length);
    console.log("done ? : " + result.done);
});


use + to concat string like "SELECT Id,Body,Name FROM Attachment where ParentID = " + acc

I tried concanating..but it is not entering the conn.query block... if i put a debug, it is coming out...and not priniting those console lines

Sidenote: Is the colon at the end of your code intentional? Usually there should have been a semicolon

sorry my mistake while editing the code here
