Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (W-Z)
Guardian Procedure Calls Reference Manual—522629-013
16-9
WRITE[X] Procedures
If the file is audited, the record is available for read
operations when the transaction associated with the
write operation commits. If the transaction aborts, the
record is never available to read operations.
If the file is not audited, the record is available as soon
as the write operation finishes successfully.
Unlike other key-sequenced files, a write operation to a
queue file will never encounters an error 10 (duplicate
record) because all queue file records have unique
keys generated for them.
Relative Files After an open or an explicit positioning by its primary
key, the record is inserted in the designated position.
Subsequent WRITE[X]s without intermediate
positioning insert records in successive record
positions. If -2D is specified in a preceding positioning,
the record is inserted in an available record position in
the file.
If -1D is specified in a preceding positioning, the record
is inserted following the last position used in the file.
There does not have to be an existing record in that
position at the time of the WRITE[X].
Entry-Sequenced Files The record is inserted following the last record
currently existing in the file.
Unstructured Files The record is inserted at the position indicated by the
current value of the next-record pointer.
•
Structured files
•
Inserting records into relative and entry-sequenced files
If the insertion is to a relative or entry-sequenced file, the file must be
positioned currently through its primary key. Otherwise, the WRITE[X] fails,
and a subsequent call to FILE_GETINFO_ or FILEINFO shows that error 46
(invalid key) occurred.
•
Current-state indicators after WRITE[X]
After a successful WRITE[X], the current-state indicators for positioning mode
and comparison length remain unchanged.
For key-sequenced files, the current position and the current primary-key value
remain unchanged.
Note. If the insert is to be made to a key-sequenced or relative file and the record already
exists, the WRITE[X] fails, and a subsequent call to FILE_GETINFO_ or FILEINFO shows that
error 10 occurred.