Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

KTYP_NOISMKEYUPD mode prevents ISAM record update from changing index key value

It is possible to create an index that does not allow an ISAM update to change the key value. On such an index, an ISAM record add can add a key value and an ISAM record delete can delete a key value, but an ISAM record update cannot change a key value. (Note the special case for a variable-length record: if an ISAM update causes the record to move, the key is allowed to change its record offset from the old offset to the new offset; but the key value itself is not allowed to change.)

To create an index that uses this feature, OR the KTYP_NOISMKEYUPD bit into the key type (ikeytyp) field of the IIDX structure for that index file before calling CREIFIL() to create the index.

An ISAM record update that attempts to change a key value for an index that has this property enabled fails with error NOISMKEYUPD_ERR (1001).

If extended header support is enabled and the data file contains an extended header, a new flmode3 bit is used to indicate that the data file has one or more indexes that use the "no ISAM key update" feature. This bit is used to allow PUTIFIL() to determine if it needs to open the index files to check if their key type header field needs to be updated to reflect the state of this feature in the IIDX structures passed to PUTIFIL(). PUTIFIL() can be used to turn this bit on or off. The changes take effect immediately.

A value of the splval bit, ctIDXOPENED, can be used with the ctFILEOPENED bit in a call to PUTIFILX8(). This bit indicates that the caller has the index files open. It is useful when the caller knows that it has the index file is already open. If this bit is not specified, PUTIFILX8() attempts to open the index files. In the server model, if the index files are already open and the server tries to open them, the open will fail, but then PUTIFILX8() is able to check if the caller has the index file already open. In standalone mode, this code is not active and the PUTIFILX8() call fails in this situation.