db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George H <george....@gmail.com>
Subject Re: generated always as identity
Date Thu, 05 Mar 2009 21:09:23 GMT
Have you tried setting the start and increment values of the identity
statement like

GENERATED ALWAYS AS IDENTITY(START WITH x, INCREMENT BY y )

where x is the last auto_increment number from mysql and y is well the
step number to increment by.

--
George H
george.dma@gmail.com



On Thu, Mar 5, 2009 at 6:44 PM,  <aponb@gmx.at> wrote:
> I need to replicate data from mysql to derby. I have the init script for the
> empty derby db. Some tables have columns, which provide generated keys.
> These tables are created like this:
> create table foo (foo_id bigint not null generated always as identity
> primary key, ... );
>
> If I try to replicate my data from the other database to derby, it won't
> work because derby wants to generate the key for foo_id. So my idea was to
> create all tables with these columns without the "generated always as
> identity" statement. Then to import all data. And after then to alter the
> column again.
>
> The import worked, but what I couldn't do was to add the statement
> "generated always as identity" to the column foo_id.
> Does anybody know how can I do that?
>
>

Mime
View raw message