0
I’m starting some routines with Node.js and sqlserver.
My Coldfusion routine is a materials query and calls the Node api via cfhttp.
I need to pass as a parameter to the API two or more fields to be filtered. I am testing first with a field and my select does not register properly because of the use of LIKE.
Look at my routine:
router.get('/materialNome/:material', (req, res) =>{
let filter = '';
if(req.params.material)filter= ' WHERE NOME_SERVICO LIKE' + '%' +(req.params.material)+'%';
execSQLQuery('SELECT ID_MATERIAL,ID_FAMILIA,NOME_SERVICO FROM SERVICO.SERVICOSMATERIAL' + filter, res);
})
I don’t know how to use the like on Node.
Could someone exemplify?
You just have to be careful because this code is probably susceptible to SQL Injection.
– Luiz Felipe