Re: Getting value of bind variables

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Getting value of bind variables
Дата
Msg-id 20110823073215.GA18950@svana.org
обсуждение исходный текст
Ответ на Re: Getting value of bind variables  (Jayadevan M <Jayadevan.Maymala@ibsplc.com>)
Список pgsql-general
On Tue, Aug 23, 2011 at 09:07:20AM +0530, Jayadevan M wrote:
> I guess so. But when I tried the same query on psql by replacing ($4) with
> a value like '20110404', the query works OK. The value of $4 is being
> passed from a java application. So does this mean I have to change the
> data type in java code?

For clarity, when you put the value '20110404' in a query, that is not
a varchar. Rather it's type is coerced to whatever is most appropriate
from the surrounding SQL.

To generate the same error you need to put '20110404'::varchar in place
of the parameter.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.
   -- Arthur Schopenhauer

Вложения

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

Предыдущее
От: Giuseppe Sacco
Дата:
Сообщение: Re: SSL certificates issue
Следующее
От: alexondi
Дата:
Сообщение: Wal archiving and streaming replication