db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: Need HELP GUYS :((
Date Thu, 04 Sep 2008 19:02:46 GMT
Hello,

I guess this question should have been posted to the Derby user list 
instead of the development list.
Anyway, can't you reset the value using ALTER TABLE?

Something like this:
ALTER TABLE yourTableName ALTER COLUMN yourColumnName RESTART WITH 
theIntegerValueYouWant
Consult the reference manual for more information.


hth,
-- 
Kristian

Jessica_girl wrote:
> i have used Talend to migrate database from AS400 to Apache Derby. Everything
> is ok up to that point.
> The problem is that: since i have inserted data THROUGH Talend, Apache derby
> does not update its system tables.
> For example, since i had 5 rows in table A, the old MAX primary key value of
> table A was 5.
> When i inserted 1000 data THROUGH Talend, the new MAX primary key value
> should be 1005. However, IT IS AGAIN 5!
> This is DUE TO I HAVE NOT USED DERBY TO INSERT DATA!
>
> i have to find some way to update the system tables of my Apache Derby
> database, which i believe is SYS.SYSCOLUMNS.AUTOINCREMENTVALUE especially.
> As SYS.SYSCOLUMNS.AUTOINCREMENTVALUE of table A is still 5, as far as i have
> discovered. However it should be 1005.
>
> in other words 
>
> I have used Talend to migrate the database from AS400 to Apache Derby
> database. Everything worked good at that point. Now, i have the correct data
> values in my Apache Derby database.
> But the problem is that, since i inserted the data into Apache Derby
> database through Talend, Apache Derby does not know that the primary key
> values are now different and higher. SYS.SYSCOLUMNS.AUTOINCREMENTVALUE,
> which Apache Derby uses to keep track of the highest primary key values in
> the tables, is not updated accordingly. As a result, when i want to insert
> new data values collisions occur and i get primary key violation errors.
>
> What i should do Derby to update system table values also, especially the
> SYS.SYSCOLUMNS.AUTOINCREMENTVALUE column?
>
> Please hep me
>   


Mime
View raw message