Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Generated Integer Field ignoring seed value
Fri, Oct 8 2010 5:26 AMPermanent Link

Surjanto Kwe

PT. Usahajaya Ficooprasional

Hi Tim,

Just downloaded 2.04 b4 trial and start all over again Smile

It seems that the SEED value is ignored for generated columns


Regards,


Surjanto
Fri, Oct 8 2010 5:38 AMPermanent Link

Uli Becker

Surjanto Kwe,

> Just downloaded 2.04 b4 trial and start all over again Smile

Welcome and good luck! Good decision. Smile

> It seems that the SEED value is ignored for generated columns

Have a look here:

http://tinyurl.com/2v3m788

Regards Uli
Fri, Oct 8 2010 6:18 AMPermanent Link

Surjanto Kwe

PT. Usahajaya Ficooprasional

Thanks Uli,

So how do you guys deal with data migration ? This means that we have to create special script for all the running numbers in the table ...


Regards,


Surjanto
Fri, Oct 8 2010 8:06 AMPermanent Link

Uli Becker

Surjanto,

> So how do you guys deal with data migration ? This means that we have to create special script for all the running numbers in the table ...

Are you migrating from DBISAM? If so, the last Autoinc value should be
"imported".

For cases where I change the type to generated, I use this:

SCRIPT
BEGIN
  DECLARE MAXID integer;
  DECLARE ResultCursor CURSOR for stmt;

 prepare stmt from
  ' select max(MyID) as MySeed from MyTable';
  open ResultCursor;
  Fetch First from Resultcursor(MySeed) into MAXID;
  unprepare stmt;

  Execute Immediate 'ALTER TABLE MyTable ALTER COLUMN MyID RESTART WITH
' + cast(MAXID as Varchar);
END

Regards Uli
Sat, Oct 9 2010 1:06 AMPermanent Link

Surjanto Kwe

PT. Usahajaya Ficooprasional

Uli,

I am importing from NexusDB, well thanks for your code, can get me started faster Smile

Regards,


Surjanto
Sat, Oct 9 2010 10:35 AMPermanent Link

Uli Becker

Surjanto,

> I am importing from NexusDB, well thanks for your code, can get me started faster Smile

You are welcome - if you need further help after migrating, just ask.
Generally I always use a migration to "clean" my tables. Especially the
collation of VarChar fields and the setting CaseSensitive or
CaseInsensitive are important and can avoid a lot of trouble later.

Also the indexes should match theses settings, otherwise queries can not
be optimized as expected.

Regards Uli
Image