guides:programming:programmers_reference_manual:rti_readu

RTI_READU Function

Lock and read a record from the specified table. If the table is on an MVBFS volume, then host (back-end) record locking will be performed; if the table is on an OpenInsight volume, then the record will first be locked with the LOCK statement and then (if the lock is successful) the record will be read.

Rslt = RTI_READU(table, id, recordvar)

The function has the following parameters:

ParameterDescription
TableEither the name of a table to read from, or a handle to an already-opened table
IdThe record key to read
RecordvarThe record that has been read (set by RTI_READU)

RTI_READU returns a flag indicating success (STATUS_READ_OK$), error (FS_READ_ERR$), no record found (FS_REC_DNE$), or the record has been locked by some other user and cannot be accessed (FS_SYS_LOCK_ERR$). These flags are defined in the RTI_READU_EQUATES insert (which includes the actual FSERRORS_100 insert).

SUBROUTINE READU_EXAMPLE(VOID)

$insert RTI_READU_EQUATES

RSLT = RTI_READU(“BOOKS”, “100”, BOOKREC)

BEGIN CASE

   CASE RSLT = STATUS_READ_OK$

      * Record has been read successfully

   CASE RSLT = FS_REC_DNE$

      * No such record found

   CASE RSLT = FS_SYS_LOCK_ERR$

      * Record locked

   CASE RSLT = FS_READ_ERR$

      * Other (fatal) error

END CASE

RETURN 0
 
 
 
 
  • guides/programming/programmers_reference_manual/rti_readu.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1