Click here to Skip to main content
15,614,421 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello! hope you are doing well.
Im trying to update a database from nodejs.
But when i try to check it out on postman i got the error from the catch that i created.
Is it something that im doing wrong?.
The erro in the console is
Named parameter ":id" has no value in the given object.

What I have tried:

server.put("/estudiantes/:id", async(req, res) => {
  const bodyParam = req.body;
  const idParam =;
    const estudiantes = await db.query(`
    UPDATE estudiantes
SET :nombre :apellido :pais :edad
WHERE :id`,{
          type: db.QueryTypes.UPDATE
  }catch (error){
    res.json({error:'Internal server error'})

Afzaal Ahmad Zeeshan 19-Mar-21 11:15am    
Not sure, but I think this part replacements:{id: needs to be only replacements:{id: idParam. Because you are reading the ID from the URL, and I would expect it to be a value, not an object.
Federico Arnaudo 19-Mar-21 17:38pm    
Thanks, but i tried and im still having the same error.

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