Subject | Re: [Firebird-Java] Create auto-increment primary key? |
---|---|
Author | Stefan Mühlemann |
Post date | 2004-06-08T05:05:48Z |
phil_hhn wrote:
CREATE GENERATOR GENERATOR_FOR_MY_ID;
INSERT INTO MY_TABLE(ID) VALUES(GEN_ID(GENERATOR_FOR_MY_ID, 1));
See also: http://www.fingerbird.de/generatorguide.htm
Stefan
> Hi, I have a script which I run to create my database. Is there a wayYou can use Generators.
> (using standard SQL) to specify that a PK is an auto-increment column?
> (I.e I understand AUTO_INCREMENT is a MySQL extension and non-standard).
> Thanks
>
CREATE GENERATOR GENERATOR_FOR_MY_ID;
INSERT INTO MY_TABLE(ID) VALUES(GEN_ID(GENERATOR_FOR_MY_ID, 1));
See also: http://www.fingerbird.de/generatorguide.htm
Stefan