Release 10.1A: OpenEdge Development:
ADM and SmartObjects

> ## Nondata fields in the RowObject and RowObjUpd temp-tables

> A RowObject temp-table contains more than just fields selected from database tables. It also contains the following information:

> - A temp-table definition (the first line of the table).

> - Field definitions for the temp-table data (corresponds to the database data).

> - Field definitions for the temp-table itself.

> - Index definitions.

> For example:

>     DEFINE TEMP-TABLE RowObject RCODE-INFORMATION

>       FIELD Cust-Num LIKE Customer.Cust-Num VALIDATE ~
>       FIELD Name LIKE Customer.Name VALIDATE ~
>       FIELD Address LIKE Customer.Address VALIDATE ~
>       FIELD City LIKE Customer.City VALIDATE ~
>       FIELD State LIKE Customer.State VALIDATE ~
>       FIELD Postal-Code LIKE Customer.Postal-Code VALIDATE ~

>       FIELD RowNum   AS INTEGER
>       FIELD RowIdent AS CHARACTER
>       FIELD RowMod   AS CHARACTER

>       INDEX RowNum   IS PRIMARY RowNum
>       INDEX RowMod   RowMod
>       INDEX RowIdent RowIdent.

> The RowObject temp-table contains three special fields, `RowNum`, `RowIdent`, and `RowMod`. These fields. which are maintained by the SmartDataObject support code, are used to manage queries and updates as follows:

> - `RowNum`—An integer value that represents the sequence number of the row within the query’s result set. A unique value is assigned to each row as it is added to the table; basically it is used to keep the rows in a consistent sort order. The values begin arbitrarily with 900,000, which generally assures that the values of this field remain positive whether the temp-table is built forward or backward.

> - `RowIdent`—A character field that contains a comma-separated list of the `ROWID`s of the database records from which the RowObject row is derived. The database `ROWID`s are used to re-retrieve the records from the database when performing an update. If the records in the RowObject temp-table result from a join, the `ROWID`s in this field are a combination of the `ROWID`s for the joined tables.

> - `RowMod`—A character field that contains a one-character code that indicates the kind of update operation performed on a row:

> - For a newly added row, RowMod is set to `A` if the row results from an Add operation or `C` if it is results from a Copy operation.
> - For a row that is to be deleted, RowMod is set to `D`.
> - An Update operation returns two rows: a copy of the row as it was received, for which RowMod is set to `“”`, and the row with its changes, for which RowMod is set to `U`. The copy of the row as received is used to verify that the corresponding database records were not changed since the user accessed the row, and the row with changes is used to update the database.

> The RowObjUpd temp-table contains the same fields as the RowObject temp-table plus the `ChangedFields` field, which is used only for updates:

> - `ChangedFields` (RowObjUpd temp-table only) — A character field that contains a comma-separated list of the names of all SmartDataObject columns in the current row that were modified. This list is used to ensure that only those fields that were not changed previously are written back to the database, to minimize interference between different users of an application who might be changing different fields in the same record. This field is maintained automatically by the SmartDataObject support code, regardless of how each field’s value may have been changed.

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