Creating Generators

From InterBase

Go Up to Working with Generators


To create a unique number generator in the database, use the CREATE ­GENERATOR statement. CREATE GENERATOR declares a generator to the database and sets its starting value to zero (the default). If you want to set the starting value for the generator to a number other than zero, use SET ­GENERATOR to specify the new value.

The syntax for CREATE GENERATOR is:

CREATE GENERATOR name;

The following statement creates the generator, EMPNO_GEN:

CREATE GENERATOR EMPNO_GEN;
Note:
Once defined, a generator cannot be deleted.

Advance To: