db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diego Cattelan <netman...@libero.it>
Subject Identity/Sequence
Date Wed, 14 Jun 2006 11:22:28 GMT
Hi, i'm investigating on using derby for some new project i'll start 
next week, but i'm facing in some trouble/misunderstanding of  derby 
identity.

If i declare a column as

  ... GENERATED ALWAYS AS IDENTITY

derby fills it correctly with an increasing value.

My problem is:
in my application logic i will obviously reuse previous-projects 
libraries in wich sometimes i use two tables sharing the same 
generator/sequence. In Oracle,PostgreSQL and Firebird i do something like

<pseudocode>

create sequence asequence starting with 1;

create table tableA(
...
	id integer GENERATED ALWAYS AS IDENTITY BY asequence,
...)

create table tableB(
...
	id integer GENERATED ALWAYS AS IDENTITY BY asequence,
...)
</pseudocode>

i need to do the same with derby, but how can i do that ?

Tanks


Mime
View raw message