Skip to content

I think I found a bug #840

Closed Answered by porsager
eiagit asked this question in Q&A
Apr 1, 2024 · 3 comments · 18 replies
Discussion options

You must be logged in to vote

Ok, this should work with your current names

app.get("/usuario/pesquisa",async(req,res)=>{
    try {
        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 ${ sql(req.query.USO_CAMPO) } LIKE 
          ${ '%' + req.query.USO_NOME + '%' } 
          ORDER BY "USO_NOME"
        `
        res.status(200).json(results)
        console.log(results)
    } catch (err) {
        console.log(err)
        res.status(500).json({ 'error': err })
    }         
})

but this is much mor…

Replies: 3 comments 18 replies

Comment options

You must be logged in to vote
17 replies
@porsager
Comment options

@eiagit
Comment options

@porsager
Comment options

@porsager
Comment options

Answer selected by porsager
Comment options

You must be logged in to vote
1 reply
@porsager
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants