Hello all!
I'm a niewbie in node.js.
I have a mssql procedure(
kdar_emp_eidos1
) with 2 parameters .
It runs well but i can't get the output this procedure returns.
async kdar_emp_eidos1(prod) {
const conn = await mssqlcon.getConnection();
const res = await conn.request()
.input("customer_code", prod.customer)
.input("item", prod.item)
.execute("kdar_emp_eidos");
console.dir(res.recordsets);
console.log(res.recordsets);
return res;
}
When i run it in postman i get
{
"recordsets": [
[]
],
"recordset": [],
"output": {},
"rowsAffected": [
0
],
"returnValue": 0
}
and in console empty recordsets
[ [] ]
[ [] ]
.
Can you help me get the recordset right?
What I have tried:
I have try to res.send(recordset);
console.log(recordset.recordsets[0].length);
for (var i = 0; i < recordset.recordsets[0].length; i++)
{
console.log(recordset.recordsets[0][i].id);
}
but i get the same results.