//node route [id] as a param
router.get('/exroute/:id', function (req, res) {
//establish connection
mssqlPool.connect()
.then(() => {
//Get query from ms-sql
return mssqlPool.query`select * from tblEmp where
Emp_strID = ${req.params.id}`;
}).then(result => {
//convert to json the response
res.json({ 'data': mssqlparseDate(result.recordset) })
}).catch(err => {
//throw error if any
res.json(err)
})
.then(() => {
//close the connection
return mssqlPool.close();
});
});
XML列已转换为中文文本。 列中的样本数据:-
样本输出:- 뀁愇搀搀爀攀猀猀\u0000毡愀渀最甀愀最攀\u0000ᄂ攂渀ࣰbuildingï̀ϸUjjainRoad猆琀爀攀攀琀**