Description

Returns one or more rows from a table.

Syntax

Read_Row (tablename, keylist, lockflag, readonlyflag)

Parameters

The Read_Row routine has the following parameter.

ParameterDescription
tablenameThe name of the table that contains the row to read.
keylistA key or list of keys to read from tablename. The list should be an @fm-delimited list.
lockflag

Specifies whether or not the row is locked during the read operation. If null, no locking takes place. If a row is locked, it remains locked after the procedure is completed.

LockflagDescription
0No locking takes place.
1Row is locked prior to read and remains locked.
readonlyflagSpecifies whether or not this row is read-only (not be updated). If true (1), the read request may be fulfilled from any cache or buffers maintained by the system. Otherwise, the row must be read from disk.

Returns

Returns the rows specified in keylist. If a single key is passed to the routine the results will be placed into the @RECORD system variable, as well as the SYSTEM RECEIVER. If multiple keys are passed to the routine, a SYSTEM RECEIVER must be implemented and the data will be returned to the RECEIVER. Data returned to the RECEIVER will contain tab-delimited field values and carriage return/line feed separated records.

See also

LockUnLockWrite_RowRECEIVER property

Example Using System Monitor

  • This command reads the customer records "1" and "12".
  • This command is meant to be run form the SYSTEM MONITOR
run Read_Row "CUSTOMERS", [1, 2]
* This will return the contents of keys 1 and 2 from the Customers table.

Example Using RECEIVER

* Capture text results of Read_Row in the edit box EDITBOX_RESULTS.
 
Declare Function Get_Property
Declare Subroutine Set_Property, Read_Row
 
Set_Property ("SYSTEM", "RECEIVER", @window: ".EDITBOX_RESULTS")
Set_Property (@window: ".EDITBOX_RESULTS", "TEXT", "")
Read_Row("CUSTOMERS",1 : @fm : 2, "", "")
recordData = Get_Property (@window: ".EDITBOX_RESULTS", "TEXT")
swap TAB$ with @fm in recordData
swap CRLF$ with @rm in recordData
 
* reset the receiver property to null.
Set_Property ("SYSTEM", "RECEIVER", "")
  • No labels