Skip site navigation (1) Skip section navigation (2)

Re: sequences in JDBC

From: "Nick Fankhauser" <nickf(at)ontko(dot)com>
To: "Dave Harkness" <daveh(at)MEconomy(dot)com>, "pgsql-jdbc" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: sequences in JDBC
Date: 2001-09-26 21:29:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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

In response to

pgsql-jdbc by date

Next:From: Nick FankhauserDate: 2001-09-26 21:40:50
Subject: Re: connection error
Previous:From: Dave HarknessDate: 2001-09-26 21:25:44
Subject: Re: sequences in JDBC

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group