I have an existing Derby database to which I want to add a new column which 
will be filled with unique (monotonically increasing) values. Now, for new 
records being added to the database that is easy: an identity column will do 
that nicely. But I want to update all the existing rows in the database.

Ideally I want to write SQL which looks like:

  UPDATE Artist set artistNum = ... WHERE artistNum is NULL

But I can't see how to do this. In MySQL I'd be using variables which increment 
for each row written. In Derby is the only solution to use a Procedure? Are 
there any examples of something similar: I can see how to write a procedure, 
but couldn't find any examples of how to update lots of rows of data like this. 
Am I missing the point?


Thanks
Ari


--
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Reply via email to