Re: Error selecting constant

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Error selecting constant
Дата
Msg-id 48AF4A83.4060400@opencloud.com
обсуждение исходный текст
Ответ на Error selecting constant  (Mat <mat@voxmobili.com>)
Список pgsql-jdbc
Mat wrote:

> org.springframework.dao.DataRetrievalFailureException: Problem executing
> statement: SELECT '?_?' as result with values [str1, str2]; nested
> exception is org.postgresql.util.PSQLException: The column index is out
> of range: 1, number of columns: 0.

Try "SELECT ? || '_' || ?"

Parameter substitution is not just substitution into the query string,
you can only put ? where it makes sense to have a selfcontained data
value. And it's definitely not going to work inside a string constant,
the driver must interpret that '?' as a literal '?' not a parameter
placeholder!

-O

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Mat
Дата:
Сообщение: Error selecting constant
Следующее
От: "kumar, Anand (Anand)"
Дата:
Сообщение: ssl support in XA Datasource