Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900