Re: error code invalid_input_syntax

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: error code invalid_input_syntax
Дата
Msg-id Pine.BSO.4.61.0601121630100.25024@leary.csoft.net
обсуждение исходный текст
Ответ на error code invalid_input_syntax  (Rainer Leo <leo@workfile.de>)
Список pgsql-jdbc

On Thu, 12 Jan 2006, Rainer Leo wrote:

> I wrote a function which generates SQL statements
> for INSERTs and UPDATEs, in which I cast the values
> to the correct datatype.
>
> ERROR:  invalid input syntax for integer: "i"
>
> but although I tried quite a few I can't find the right
> error code for this exception.
>

You can easily check the error code via SQLException.getSQLState().  A
quick test in psql will also demonstrate its value.

jurka=# \set VERBOSITY verbose
jurka=# select 'a'::int;
ERROR:  22P02: invalid input syntax for integer: "a"
LOCATION:  pg_atoi, numutils.c:84

Kris Jurka

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

Предыдущее
От: Rainer Leo
Дата:
Сообщение: error code invalid_input_syntax
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: reading an oidvector field error