Can you use “?” for parameters in postgres SQL?

This should be stupidly simple to answer, but for the life of me I cannot find a definitive answer on this.Can you use "?" in postgres, like you can in other database engines?For example:\[code\]SELECT * FROM MyTable WHERE MyField = ?\[/code\]I know I can use the $n syntax for this, for example from psql this works:\[code\]CREATE TABLE dummy (id SERIAL PRIMARY KEY, value INT);PREPARE bar(int) AS INSERT INTO dummy (value) VALUES ($1);EXECUTE bar(10);SELECT * FROM DUMMY;\[/code\]But if I try to prepare a statement using "?", eg.\[code\]PREPARE bar(int) AS INSERT INTO dummy (value) VALUES (?);\[/code\]I get:\[quote\] ERROR: syntax error at or near ")" LINE 1: PREPARE bar(int) AS INSERT INTO dummy (value) VALUES (?);\[/quote\]...and yet, in various places I read that "postgres supports the ? syntax".What's going on here? Does postgres support using ? instead of $1, $2, etc. If so, how do you use it?Specifically, this is making my life a pain porting a bunch of existing sql server queries to postgres, and if I can avoid having to rewrite all the where conditions an all of the sql statements that would be very, very nice.
 
Back
Top