Release 10.1A: OpenEdge Data Management:
DataServer for ORACLE

> ## Sequence generator

> A sequence generator is a database object that provides incremental values within any integer range. You can specify any positive or negative increment. The DataServer supports the ORACLE sequence generator. To define ORACLE sequences, you use the SQL `CREATE` `SEQUENCE` statement and indicate the name, minimum and maximum values, increment, and whether numbers are reused. For example, this is the code for creating a sequence named `seq-table-name` that starts with 1 and increments by 1:

>     CREATE SEQUENCE seq-table-name START WITH 1 INCREMENT BY 1

> Note: Do not define ORACLE sequences with names ending in `_SEQ` unless this manual instructs you to do so. The DataServer uses ORACLE sequences whose names end in `_SEQ` for internal purposes.

> Table 2–3 compares the features of the OpenEdge and ORACLE sequence generators. An application that relies on sequence generators can access an OpenEdge database and, through the DataServer, an ORACLE database. See the chapter on database access in OpenEdge Development: Progress 4GL Handbook for information on defining and using OpenEdge sequences in your database applications.

> Table 2–3: OpenEdge and ORACLE sequence generators
> Characteristic | OpenEdge | ORACLE
> --- | --- | ---
> Maximum/minimum range. | Yes | Yes
> Ascending/descending. | Yes | Yes
> Adjustable incrementation. | Yes | Yes
> Database object. | Yes | Yes
> Loses a number when a record creation fails. | Yes | Yes
> Sequence is disrupted during dumping or loading. | No | Yes

> If you add a sequence to a table in your supporting ORACLE database, you must update the schema image to reflect this addition. See Chapter 7, "The Data Server Tutorial," for instructions on updating a schema image.

> There are two Progress 4GL functions that provide information about database sequences, `NEXT-VALUE` and `CURRENT-VALUE`. When you use the DataServer, you can use these functions to get information about sequences in your ORACLE database, but you must use the `NEXT-VALUE` function first in the same session you use the `CURRENT-VALUE` function.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095