cannot dollar-quote $$?$$ in PreparedStatements
| От | Marc Herbert |
|---|---|
| Тема | cannot dollar-quote $$?$$ in PreparedStatements |
| Дата | |
| Msg-id | khjoe2jt2ip.fsf@meije.emic.fr обсуждение исходный текст |
| Ответы |
Re: cannot dollar-quote $$?$$ in PreparedStatements
|
| Список | pgsql-jdbc |
With 8.0 postgresql and driver, this works fine:
ps = con.prepareStatement("insert into product values(?, '?' , ?)");
But this fails:
ps = con.prepareStatement("insert into product values(?, $$?$$ , ?)");
It looks like "someone" (driver or engine?) is counting 3 parameters instead of 3:
org.postgresql.util.PSQLException: Pas de valeur specifiee pour le parametre 3.
at org.postgresql.core.v3.SimpleParameterList.checkAllParametersSet(SimpleParameterList.java:102)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:166)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:282)
at TestFetchSize.main(TestFetchSize.java:86)
How dollar-quoting and question marks are supposed to interact?
Sorry if this a well-known issue.
В списке pgsql-jdbc по дате отправления: