Subject | Re: [firebird-support] Re: Auto-increment and generators |
---|---|
Author | Milan Babuskov |
Post date | 2004-02-10T18:10:21Z |
h_urlaf wrote:
the best thing is to SET GENERATOR g1 TO that_id + 1;
import data from some external source, and you want to be able to set
the proper values for primary key (since it may be referenced from other
table)
--
Milan Babuskov
http://fbexport.sourceforge.net
> Because we have a situation where the IDs can usually be 'random' asIf you're setting it to some specific ID which is > gen_id(g1, 0), then
> long as they're unique, but in some instances we want a specific ID.
the best thing is to SET GENERATOR g1 TO that_id + 1;
> Then what is the point of things likeThe point is that sometimes you want to copy data from other table, or
>
> if (new.ID is null) then new.ID = gen_id(g1, 1);
import data from some external source, and you want to be able to set
the proper values for primary key (since it may be referenced from other
table)
--
Milan Babuskov
http://fbexport.sourceforge.net