Progress
DataServer
for ORACLE Guide
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, incrementation, and whether numbers are reused. For example, this is the code for creating a sequence named table-name_SEQ that starts with 1 and increments by 1:
ORACLE does not allow you to change the starting value of a sequence. If you change the value in Progress and then run the DELTA SQL utility, the ORACLE SQL file has an entry like this:
If you load this SQL into ORACLE, you get an ORACLE error telling you that you cannot change the starting sequence number. The workaround for this is to drop the sequence and add it again.
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 Progress and ORACLE sequence generators. An application that relies on sequence generators can access a Progress database and, through the DataServer, an ORACLE database. See the chapter on database access in the Progress Programming Handbook for information on defining and using Progress sequences in your database applications.
If you add a sequence to a table in your supporting ORACLE database, you must update the schema image to reflect this addition. See "The DataServer 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 © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |