Re: Pass column name in preparedstatement

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Pass column name in preparedstatement
Дата
Msg-id 4211E2E1.4090506@opencloud.com
обсуждение исходный текст
Ответ на Pass column name in preparedstatement  (Antony Paul <antonypaul24@gmail.com>)
Ответы Re: Pass column name in preparedstatement  (Antony Paul <antonypaul24@gmail.com>)
Список pgsql-jdbc
Antony Paul wrote:
> Hi all,
>     Is it possible to pass column name to a PreparedStatement as a
> parameter.

No, you can only use parameter placeholders in places which the backend
grammar allows parameters (namely, in expressions). Column names aren't
one of those places.

> Or should I use Statement.

You can use either Statement or PreparedStatement so long as you insert
the column name into the SQL query string yourself before giving it to
the driver.

-O

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

Предыдущее
От: Antony Paul
Дата:
Сообщение: Pass column name in preparedstatement
Следующее
От: Antony Paul
Дата:
Сообщение: Re: Pass column name in preparedstatement