Database Functions Quick Reference

The table below is not intended as an exhaustive list. Refer to the documentation of each function for full details

Function Flag Meaning
rec_fetch()
dp4_rec_fetch
rec_fetch_main()
bf_fetch()
dp4_bf_fetch()
blk_fetch() dp4_blk_fetch()
EQUAL This searches the table for a record that exactly matches on all keys
FIRST This finds the first record in the logical sequence of the index
NEXT This finds the next record in the logical sequence of the index. It depends on the current value of the data record
LAST This finds the last record in the logical sequence of the index
PREV This finds the previous record in the logical sequence of the index. It depends on the current value of the data record
DEPTH Indicates the number of parts of a multi-part key that are to be used for matching. Only needed in C. You can "or" DEPTH into flags to be passed to a fetch function, or you can use one of the pre-defined value: FIRST_DEPTH, NEXT_DEPTH, LAST_DEPTH PREV_DEPTH
LOCK If a matching entry is found and is not locked by another user, it is marked as locked and the global variable locked is set to TRUE
UNLOCK If the record is locked, it is unlocked immediately (instead of at the next checkpoint operation)
rec_post_with_flags
dp4_rec_post()
NO_CHECK No parent checking is performed. rec_post(&rec.l) is equivalent to rec_post_with_flags(&rec.l,NO_CHECK)
CHECK_PARENT The next commit or checkpoint operation fails for this record if the parent is missing in any of the indexes marked for parent checking
VERIFY_PARENT The next commit or checkpoint operation fails for this record if the parent is either missing, or has been updated since the start of the transaction in any of the indexes marked for parent verification
CHECK_CHANGE The next commit or checkpoint operation fails for this record if the record is an amendment of an existing record, and any of the secondary indexes marked for change prevention have been changed
db_update()
dp4_db_update()
COMMIT This writes the transaction to the database, so its changes are visible to all users but does not definitely secure it in the event of a system failure. . Locked records remain locked. db_commit() is the same as db_update(COMMIT)
CHECKPOINT This writes the transaction to the database, so its changes are visible to all users and guarantees that it will be secure in the event of a system failure. Locked records are unlocked. db_checkpoint() is the same as db_update(CHECKPOINT)
FLUSH_LOG This writes the transaction to the database, so its changes are visible to all users and guarantees that it will be secure in the event of a system failure. Locked records are NOT unlocked.
rec_kill
dp4_rec_kill()
ORPHAN_CHECK This prevents a record from being deleted if it has one or more child records on the database. This check is only applied if any children exist in any of the indexes that you marked for orphan checking when you set up the database. The check is also made for any of the children which would be deleted by the flag CHILD_DELETE
CHILD_DELETE This has the effect of automatically deleting any children that belong to the record that you wish to delete. All further levels of children are also deleted
IGNORE_CHILD This disables all orphan checking, and suppresses all child deletion