Search code examples
postgresqldatagrip

Postgresql: pass variable to varchar column in update query?


I have the following query:

update car set name=${carName} where id=${carId};

carName is a variable in this case I set to string value myCarName.

When I run this in DataGrip I get:

[42703] ERROR: column "myCarName" does not exist

What syntax do I need to follow to be able to run this query and set car.name column (varchar) to the value found in carName?

if I try to quote it, then it won't recognize the variable: enter image description here


Solution

  • One needs to quote parameter value inside Parameters popup

    enter image description here