Progress
DataServer
for ODBC Guide
ROWID Function
The ROWID data type provides a unique record identifier that is compatible across Progress databases and ODBC data sources. Applications that use the ROWID function behave in the same way whether they access records in a Progress databases or in an ODBC data source. The ROWID function is more consistent than RECID across data sources. Progress Software Corporation recommends that you replace the RECID function with ROWID in existing applications.
The DataServer supports the ROWID function for ODBC data-source tables that have a unique index. The Progress Data Dictionary uses an index that meets this criterion to provide values for the ROWID function. If you build your schema holder using Progress compatibility from the Progress-to-ODBC utility, the Progress Data Dictionary automatically designates a ROWID index; however, you can select a different unique index in a data-source table to support ROWID. See the "Defining the ROWID" section in "The DataServer Tutorial," for instructions.
The ROWID value in an ODBC data source differs from the ROWID value in a Progress database in the following ways:
- In Progress, you can create a ROWID without creating a record. In DataServer applications, creating a ROWID creates a record. The following statement illustrates the difference in behavior:
The DataServer creates a customer record using default values. After the user assigns values to the fields in that record, the DataServer updates it. When you UNDO the transaction, the DataServer deletes the record.
- The ROWID changes if the value of the unique keys in the designated index changes.
- The DataServer considers a single instance of the unknown value to be unique, so it is possible to have a ROWID with the unknown value. However, the Progress ROWID function fails if you search for an unknown value, because a Progress ROWID will never have the unknown value. For example, the following FIND statement fails even if there is a row with the unknown value in the designated column:
- If you force the creation of a record before entering the value for the designated column (for example, by committing a transaction or releasing or validating a record), the creation fails if the column cannot have NULL values. If the column can have NULL values, the DataServer assigns the new record a ROWID of NULL. However, if the column has an initial value, the DataServer creates the row with that initial value as the ROWID.
Follow these guidelines when using ROWID in applications that you want to deploy across multiple Progress databases and/or ODBC data sources:
- Do not try to get a record’s ROWID value before the user assigns values to the unique keys of the 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 session, but you cannot rely on them to be the same across sessions.
For a complete description of the ROWID function, see its reference entry in the Progress Language Reference.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |