db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Rodriguez <crodrig...@gmail.com>
Subject Inserting values in an identity column
Date Mon, 07 Mar 2005 20:49:23 GMT
Hi everyone,

I am trying to import data from a mysql dump file. Basically, I need
to insert values in tables. Some of the tables in mysql include
auto_increment columns, that I have translated to "generate always as
identity" in derby. Now... the mysql dump file has values in those
columns, and I get an error when trying to insert a value into an
IDENTITY column in derby. How can I do this?

I have a couple of ideas, but none work:

1. I could define the column as a regular column (not identity) and
after the values have been populated I could try to ALTER the column
in the table to make it an identity column, but this last part doesnt
seem posible.
2. Is there another way to implement "autoincrement" in derby?
3. Is it posible to disable the "identity" feature until all values
have been populated?

Any other ideas?

Of course, I could let derby generate values for that identity column
and then map the original values with those, and touch all the
references in the other tables and convert them to the new identity
values, but that doesnt seem like a lot of work... and Im getting the
feeling there should be a more reasonable way to import "dumps" from
other databases...

Thanks for any help you can give me,

View raw message