Description

Write a record to the specified table, and then release the lock on the record. If the table is on an MVBFS volume, then host (back-end) record locking will be released; if the table is on an OpenInsight volume, then the record will be written and then UNLOCKed.

Syntax

Rslt = RTI_WRITERELEASE(table, id, record)

Parameters

The function has the following parameters:

ParametersDescription
TableEither the name of a table to write to, or a handle to an already-opened table
IdThe record key to write
RecordvarThe record to write

Returns

RTI_WRITERELEASE returns a flag indicating success (STATUS_WRITE_OK$) or error (FS_WRITE_ERR$). These flags are defined in the RTI_READU_EQUATES insert (which includes the actual FSERRORS_100 insert).

See also

RTI_READURTI_WRITEU

Example

SUBROUTINE WRITERELEASE_EXAMPLE(VOID)
$insert RTI_READU_EQUATES
RSLT = RTI_READU(“BOOKS”, “100”, BOOKREC)
BEGIN CASE
   CASE RSLT = STATUS_READ_OK$
      * Record has been read successfully – now change it
      BOOKREC<20> = DATE()
      WRSLT = RTI_WRITERELEASE(“BOOKS”, 100, BOOKREC)
       * Record has been updated and the lock has been released
   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
  • No labels