guides:programming:programmers_reference_manual:rti_writeu

RTI_WRITEU Function

Write a record to the specified table, leaving any locks on the record set. If the table is on an MVBFS volume, then host (back-end) record locking will be maintained; if the table is on an OpenInsight volume, then the record will just be written without changing the LOCK on the record.

Rslt = RTI_WRITEU(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_WRITEU 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 WRITEU_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_WRITEU(“BOOKS”, 100, BOOKREC)

       * Record has been updated but the lock is still set

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