Re: Postgres 8.1 sequences and 'CALL'-syntax - Mailing list pgsql-general

From Kris Jurka
Subject Re: Postgres 8.1 sequences and 'CALL'-syntax
Date
Msg-id Pine.BSO.4.63.0604270330590.19710@leary2.csoft.net
Whole thread Raw
In response to Postgres 8.1 sequences and 'CALL'-syntax  ("Schnabl, Sebastian" <s.schnabl@qualitype.de>)
List pgsql-general

On Thu, 27 Apr 2006, Schnabl, Sebastian wrote:

>
> Hello,
>
> I use postgres 8.1 and trie to run jboss over sequoia-ha
> (http://sequoia.continuent.org/HomePage). But i have an problem with
> sequences. Sequoia claims to support for good reasons and db-independece
> only "sql-standard(s)". Therefore they DON'T support the
> postgres-specific "select nextval('seq_name')". Instead they gave me the
> hint to use the sql-conform "call nexval('seq_name')".

I'm not sure where they layer their stuff on, but the pg jdbc driver will
support something like the following:

Connection conn = ...
CallableStatement cs = conn.prepareCall("{? = call nextval('seq_nm')}");
cs.registerOutParameter(1, Types.BIGINT);
cs.execute();
long nextval = cs.getLong(1);
cs.close();

Kris Jurka

pgsql-general by date:

Previous
From: "SunWuKung"
Date:
Subject: triger and transaction
Next
From: "Chris Velevitch"
Date:
Subject: Re: Mailing list setup issue