Subject Re: [ib-support] Setting a generator to the maximum value of the primary key
Author Helen Borrie
At 02:40 PM 05-10-01 +0100, you wrote:
> > >
> > >I have data that I have migrated from Paradox to InterBase. I am
> > >writing a script with all the updates that I am making to the data, as I
> > >will have to go through this process again.
> > Were the Author records committed before you tried to select
>Yeah, the records are all committed. The migration was done separately from
>this work I'm doing now on the data.

Hmm, the doc doesn't say you can't use an expression in SET GENERATOR but it doesn't say that you CAN, either. But I confirm that it won't accept anything but a single integer following the TO keyword. What a pest.

If you want a quickish way to set a lot of generators manually, try using the free IB_SQL utility from the site. Get set up with a Browser window, on the Generators page and a DSQL window - just do your

select max(pk) from atable

in the DSQL page, pick up the output from the Fields page and enter it into the value cell on the Generators grid. It gets updated immediately.

Just an idea..


All for Open and Open for All
InterBase Developer Initiative ยท