Re: sequences in JDBC

Поиск
Список
Период
Сортировка
От Nick Fankhauser
Тема Re: sequences in JDBC
Дата
Msg-id NEBBLAAHGLEEPCGOBHDGAEGHDLAA.nickf@ontko.com
обсуждение исходный текст
Ответ на Re: sequences in JDBC  (Dave Harkness <daveh@MEconomy.com>)
Список pgsql-jdbc
Thanks Dave! That's exactly what I needed to know. -Nick

> The problem is that it is treating "nextval..." as a literal string and
> then trying to convert it to a number (as that is the column's type). You
> need to change it to this:
>
> final String address_lineInsert = "insert into address_line( address_id,
> address_line_id, address_line_text) values (?,
> nextval('address_id_seq'), ?)";
>
> This way Postgres will execute the nextval function as you wanted.
>
> Peace,
> Dave
>


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

Предыдущее
От: Dave Harkness
Дата:
Сообщение: Re: sequences in JDBC
Следующее
От: "Nick Fankhauser"
Дата:
Сообщение: Re: connection error