PostgreSQL – ERROR: operator does not exist: integer = character varying

[code type=sql]

select ExampleName as “name”
from ExampleTable
where ExampleId = ?::integer
order by ExampleName ASC

? :: integer is a type cast in the PostgreSQL shorthand syntax. You can write the SQL standard CAST(? AS integer) if you prefer.

Share and Enjoy !

0 0