Subject Re: [Firebird-Java] Create auto-increment primary key?
Author Stefan Mühlemann
phil_hhn wrote:

> Hi, I have a script which I run to create my database. Is there a way
> (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
>

You can use Generators.

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