I am using node.js to connect to a DB2 database and loading different queries. But I would like to use parameters from user input. My connection string is:
var ibmdb = require("ibm_db")
, cn = "DATABASE=namedb;HOSTNAME=hst;UID=portal;PWD=portalpwd;PORT=50000;PROTOCOL=TCPIP;"
;
But my query is static, I need to pass parameters/variables from user input.
I am using user input with var rl = require('readline'); but the problem now is how to communicate variables to this query and put dynamic parameters not a single value like name, id etc.
var rows = conn.querySync(
"select name,id,uid,password,type from db21.rep_name fetch first 10 rows only"
);
bindingParametersargument toquerySync()?