I have written a Oracle query in Javascript file which will return the last_name,first_name,ID,Dept of employee based on the parameters it receives. Here is the Query:
var sqlstr="Select last_name,first_name,ID,Dept from employee where dept=? and ID=?";
var sql= new SQL(connection,sqlstr);
sql[1]=dept;
sql[2]=ID;
The list is :
var dept=["CS","maths","english"];
var ID=[1,2,3,4,5];
Right now I have hard coded the values of both the list but these list are dynamic and they can have different number of values like dept here are 3 but there can be 4 or 5 or more, same is with ID list. I am receiving an error of Unsupported type because I am passing a list to SQL query. I want to execute this sql queries for all the values in the lists, so how can I do this?