Progress
DataServer
for ORACLE Guide
ROWID Function
The ROWID data type provides a record identifier that is compatible across Progress and ORACLE databases. Applications that use the ROWID function behave the same way whether they access Progress or ORACLE records.
NOTE: The ROWID function might cause a newly created record to be written earlier to your ORACLE database than to a Progress database. If you do not assign values to all fields that are defined as mandatory in ORACLE for a record, the ROWID function will fail.By default, the DataServer designates a column to support the ROWID function. It evaluates the indexes available for a table and selects one in the following order:
ORACLE does not provide a native ROWID for views that contain aggregates or perform joins. For one of these views to support the ROWID function, use the Data Dictionary to select a NUMBER column, create a unique index based on it, and designate it as the ROWID.
The Data Dictionary allows you to select a different column to support the ROWID function or to select the native ROWID. See the "Defining the ROWID" section in "The DataServer Tutorial," for instructions on changing how a table supports ROWID.
The native ROWID typically provides the fastest access to a record. However, the native ROWID does not support the Progress FIND PREV/LAST statement or cursor repositioning. FIND FIRST/NEXT statements for tables that use the native ROWID as a row identifier have unpredictable results. Qualify the FIND FIRST statement with the USE-INDEX option, as in the following example, to get consistent results across various data sources:
ROWID provides the same functionality as the RECID function, but ROWID is more consistent across data sources. Replace the RECID function with ROWID in existing applications.
Follow these guidelines when using ROWID in applications that you want to deploy across several databases, such as DB2, DB2/400, Informix, ORACLE, Progress, and SYBASE:
- Do not try to get the ROWID value before the user assigns values to the unique keys of that record. Some DataServers use the unique key to generate a ROWID value.
- Refresh the ROWID value if a value of a unique key might have changed.
- Refresh the ROWID value after you undo a DELETE. The ROWID value might be different after the record is re-created.
- ROWID values are stable for a transaction. Do not rely on them being the same across transactions or sessions.
See the ROWID function entry in the Progress Language Reference for more information and examples.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |