guides:programming:programmers_reference_manual:rti_writerelease

RTI_WRITERELEASE Function

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.

Rslt = RTI_WRITERELEASE(table, id, record)

The function has the following parameters:

ParameterDescription
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

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).

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
 
 
 
 
  • guides/programming/programmers_reference_manual/rti_writerelease.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1