ReadByRowId - BaseData_Set
Finds record in specified table with record identity equal to the passed RowId without updating or altering the DDO structure
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| iFile | Integer | Number of the table in the current filelist |
| riRowId | RowID | The RowId record identity of the record to read |
Syntax
Procedure ReadByRowId Integer iFile RowID riRowId
Call Example
Send ReadByRowId iFile riRowId
Description
The ReadByRowId procedure finds a record in a specified table with the record identifier equal to the passed RowId. If it is found, a relate occurs. If the find succeeds, the Found indicator is set to True. The DDO structure is not changed by this operation.
DDO Read operations (ReadByRowid and Request_Read) find and relate records without updating the DDO. The global file buffers will contain the newly found record data but the DDO will not latch on to this record and the status of the DDOs in the structure (their current records and their field values) will not change.
DDO Find operations (Find, FindByRowId and Request_Find), do update the DDOs. Normally, you will use find methods. Read operation are used when you want to find records using a DDOs constraint without actually changing the DDO's current status.
The first parameter, iFile, may be a table name constant (e.g. Customer.File_Number) or an integer variable representing the table (e.g. (Main_File(Self)) ). The second parameter, riRowId, must be of type RowId.
You can use the Found global indicator to determine if a find was successful. If you do this, you must test the value immediately after the find as this indicator is volatile and could be changed by subsequent commands.
Procedure RereadIt Handle hoDD RowId riRow
Boolean bFound
Integer iMain
Get Main_File of hoDD to iMain // find based on main file of passed DD
Send ReadByRowId of hoDD iMain riRow
Move (Found) to bFound // move the value of the Found indicator to bFound immediately after the find
:
End_Procedure
This method is normally used to refind a record and look at the field information (in the global file buffer) without changing the values in your current DDO structure. If you need to read a specific record based on some other known value (e.g.: a customer Id or an order number) you will use the Request_Read method.
Data Dictionary SQL Filters
Data Dictionary SQL Filters cannot be used with this method. See pbUseDDSQLFilters for a list of methods that can use DD SQL filters.
See Also