jatintrivedi wrote:
I have exported a sybase db and mapped it to Derby. Derby creates the corresponding data and schema xml. One of the table has 20 rows and an auto-incremet primary key.
When i migrate my application to derby and try to insert new row it starts
with primary key id as 1 which causes an exception (unique constraint). How can i maintain the primary key after migrating to derby

Hi,

What version of Derby are you using?

If you're using 10.2, you can use the ALTER TABLE statement to restart the identity column. Have a look in the reference manual.

As an example:
ALTER TABLE myTable ALTER myIdentityColumn RESTART WITH 2000



HTH,
--
Kristian

Reply via email to