Subject | Re: [IBDI] Generator |
---|---|
Author | Doug Chamberlin |
Post date | 2000-10-27T17:16:58Z |
At 10/27/2000 01:15 PM (Friday), Robert F. Tulloch wrote:
general support list available at mers.com...
Just this one last time I will answer here <grin>...
Using generator named G, table named T, generated field named F, to assign
all existing records to generated values starting with 100 and incrementing
by one and leaving the generator ready to set the next generated value
properly, try:
SET GENERATOR G TO 100;
UPDATE TABLE T SET F=GEN_ID(G,1);
> Given an existing table, I need to a field to contain a uniqueThis is a general support question and you should be asking it in the
>number and thereafter when inserting a record, use a generator to
>get the unique number.
>
> I added a new field (not unique for now). I want to populate it
>with numbers from a generator. Can this be done with an existing
>table? Or just write a statement to fill the field with
>incrementing numbers, then set the generator start to the next
>sequential number?
general support list available at mers.com...
Just this one last time I will answer here <grin>...
Using generator named G, table named T, generated field named F, to assign
all existing records to generated values starting with 100 and incrementing
by one and leaving the generator ready to set the next generated value
properly, try:
SET GENERATOR G TO 100;
UPDATE TABLE T SET F=GEN_ID(G,1);