G. Features Introduced in Ingres 9.0 (Ingres 2006) : New Features for Application Developers : Automatic Sequence Number Generation
 
Share this page                  
Automatic Sequence Number Generation
Ingres has a sequence facility that provides the ability, through SQL, to create a column in a table that contains a sequentially incremented number for each row.
Users can define a named sequence generator by using a CREATE SEQUENCE statement. The sequence generator can produce values in any context that requires a scalar value using the phrase next value for <sequence name> or <sequence name>.nextval. The sequence generator can be used in the values list of an INSERT statement, in the select list of a query, or anywhere that a scalar numeric value is required.
The sequence facility allows sequences to be defined as integer or decimal values. Ingres permits sequences to be decimal(31), which supports a range of +/- 10**32.
Use the ALTER SEQUENCE statement to change the parameter settings for a sequence generator and the DROP SEQUENCE statement to delete a sequence generator.
For more information, see the SQL Reference Guide.