-
MY HTTP HEANDLE : MY ROUT : app.get("/usuario/pesquisa",async(req,res)=>{
try {
const params=[];
params.push(req.query.USO_CAMPO)
params.push(req.query.USO_NOME)
const results = await Execsql `SELECT "JUSO".*,"TIU_NOME"
,"STA_NOME" AS "USO_STANOM"
,"USO_FOTO"
From "JUSO"
LEFT JOIN "JTIU" ON "TIU_ID"="USO_TIPO"
LEFT JOIN "JSTA" ON "STA_ID"="USO_STATUS"
WHERE UPPER(${'"'+req.query.USO_CAMPO+'"'}) LIKE
${String.fromCharCode(39)+'%'+req.query.USO_NOME+'%'+String.fromCharCode(39)}
// ${"'%"+req.query.USO_NOME+"%'"}
ORDER BY "USO_NOME"`
res.status(200).json(results.USO_ID)
console.log(results)
} catch (err) {
console.log(err)
res.status(500).json({ 'error': err })
} THE RESULTS IS SELECT "JUSO".*,"TIU_NOME"
,"STA_NOME" AS "USO_STANOM"
,"USO_FOTO"
From "JUSO"
LEFT JOIN "JTIU" ON "TIU_ID"="USO_TIPO"
LEFT JOIN "JSTA" ON "STA_ID"="USO_STATUS"
WHERE UPPER("USO_NOME") LIKE '%ENN%'
ORDER BY "USO_NOME" it returns my data, but both scripts are the same any one can ansori this mistery ? thank you |
Beta Was this translation helpful? Give feedback.
Answered by
porsager
Apr 1, 2024
Replies: 3 comments 18 replies
-
Can you try to fix the formatting so that your code becomes readable? |
Beta Was this translation helpful? Give feedback.
17 replies
-
you are rason , the problem is with i write my code. |
Beta Was this translation helpful? Give feedback.
1 reply
-
this is only a test to connect any database. than you and Good luck. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, this should work with your current names
but this is much mor…