db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Ruehlicke" <BRuehli...@lgc.com>
Subject Global sequence generator
Date Thu, 16 Dec 2004 20:03:57 GMT
Have not found any issues in JIRA about giving Derby a global sequence
generator in the same way as Oracle and Axion (axion.tigres.org) have.

I.e. give me the option to 

CREATE SEQUENCE my_sequence;

and a my_sequence.nextval  gives me a new number/string

This is not all all the same as the table identity sequence generator
and is in my opinion way more flexible.

Anybody have some workarounds ?

Currently I do a:

    public synchronized String createKey(Connection conn) throws
        executeUpdate(conn,"INSERT INTO dual (dummy) VALUES ('a')");
        executeUpdate(conn,"DELETE FROM dual WHERE dummy='a'");
        return stringQuery(conn,"VALUES IDENTITY_VAL_LOCAL()");

which is a way around it - biut does not solve my problem.


View raw message