Developer Reference : Data Access Methods : Btrieve API Guide : Quick Reference of Btrieve Operations
 
Quick Reference of Btrieve Operations
This appendix provides a summary of Btrieve API operations in numerical order by operation code.
Table of Btrieve API Operations
Table 56 Quick Reference of Btrieve API Operations 
Operation
Code
Constant
Description
Open
0
B_OPEN
Makes a file available for access.
Close
1
B_CLOSE
Releases a file from availability.
Insert
2
B_INSERT
Inserts a new record into a file.
Update
3
B_UPDATE
Updates the current record.
Delete
4
B_DELETE
Removes the current record from the file.
Get Equal
5
B_GET_EQUAL
Returns the record whose key value matches the specified key value.
Get Next
6
B_GET_NEXT
Returns the record following the current record in the index path.
Get Previous
7
B_GET_PREVIOUS
Returns the record preceding the current record in the index path.
Get Greater Than
8
B_GET_GT
Returns the record whose key value is greater than the specified key value.
Get Greater Than or Equal
9
B_GET_GE
Returns the record whose key value is equal to or greater than the specified key value.
Get Less Than
10
B_GET_LT
Returns the record whose key value is less than the specified key value.
Get Less Than or Equal
11
B_GET_LE
Returns the record whose key value is equal to or less than the specified key value.
Get First
12
B_GET_FIRST
Returns the first record in the specified index path.
Get Last
13
B_GET_LAST
Returns the last record in the specified index path.
Create
14
B_CREATE
Creates a file with the specified characteristics.
Stat
15
B_STAT
Returns file and index characteristics, and number of records.
Extend
16
B_EXTEND
Divides a data file over two logical disk drives. This operation is not supported in Btrieve 6.0 and later.
Set Directory
17
B_SET_DIR
Sets the current directory to a specified path name.
Get Directory
18
B_GET_DIR
Returns the current directory for a specified logical disk drive.
Begin Transaction
19 1019
B_BEGIN_TRAN
Marks the beginning of a set of logically related operations. Operation 19 begins an exclusive transaction. Operation 1019 begins a concurrent transaction.
End Transaction
20
B_END_TRAN
Marks the end of a set of logically related operations.
Abort Transaction
21
B_ABORT_TRAN
Removes operations performed during an incomplete transaction.
Get Position
22
B_GET_POSITION
Returns the position of the current record.
Get Direct/Chunk
23
B_GET_DIRECT
Returns data from the specified chunks of a record at a specified position.
Get Direct/Record
23
B_GET_DIRECT
Returns the record at a specified position.
Step Next
24
B_STEP_NEXT
Returns the record from the physical location following the current record.
Stop
25
B_STOP
Terminates the Workgroup MicroKernel Engine. Not available for other instances of MicroKernel Engine.
Version
26
B_VERSION
Returns the version number of the MicroKernel Engine.
Unlock
27
B_UNLOCK
Unlocks a record or records.
Reset
28
B_RESET
Releases all resources held by a client.
Set Owner
29
B_SET_OWNER
Assigns an owner name to a file.
Clear Owner
30
B_CLEAR_OWNER
Removes an owner name from a file.
Create Index
31
B_BUILD_INDEX
Creates an index.
Drop Index
32
B_DROP_INDEX
Removes an index.
Step First
33
B_STEP_FIRST
Returns the record in the first physical location in the file.
Step Last
34
B_STEP_LAST
Returns the record in the last physical location in the file.
Step Previous
35
B_STEP_PREVIOUS
Returns the record in the physical location preceding the current record.
Get Next Extended
36
B_GET_NEXT_EXTENDED
Returns one or more records that follow the current record in the index path. Filtering conditions can be applied.
Get Previous Extended
37
B_GET_PREV_EXTENDED
Returns one or more records that precede the current record in the index path. Filtering conditions can be applied.
Step Next Extended
38
B_STEP_NEXT_EXT
Returns one or more successive records from the location physically following the current record. Filtering conditions can be applied.
Step Previous Extended
39
B_STEP_PREVIOUS_EXT
Returns one or more preceding records from the location physically preceding the current record. Filtering conditions can be applied.
Insert Extended
40
B_EXT_INSERT
Inserts one or more records into a file.
Continuous Operation
42
B_CONTINUOUS
Allows system backups without closing active MicroKernel Engine files.
Get By Percentage
44
B_SEEK_PERCENT
Returns the record located approximately at a position derived from the specified percentage value.
Find Percentage
45
B_GET_PERCENT
Returns a percentage figure based on the current record’s position in the file.
Get Key
+50
KEY_BIAS
Detects the presence of a key value in a file, without returning an actual record.
Update Chunk
53
B_CHUNK_UPDATE
Updates specified portions (chunks) of the current record. This operation can also append data to a record or truncate a record.
Stat Extended
65
B_EXTENDED_STAT
Returns file names and paths of an extended file’s components and reports whether a file is using a system-defined log key.
Login/Logout
78
B_LOGIN/B_LOGOUT
Enters user credentials to obtain authentication and authorization tokens from the database engine, or resets the credentials so that they must be entered again.
Get Next Delete Extended
85
B_GET_NEXT_EXT_DELETE
Removes records matching a filter condition, from the logical next position to the end of the file.
Get Previous Delete Extended
86
B_GET_PREV_EXT_DELETE
Removes records matching a filter condition, from the logical previous position to the beginning of the file.
Step Next Delete Extended
87
B_STEP_NEXT_EXT_DELETE
Removes records matching a filter condition, from the physical next position to the end of the file.
Step Previous Delete Extended
88
B_STEP_PREV_EXT_DELETE
Removes records matching a filter condition, Removes records matching a filter condition, from the physical previous position to the beginning of the file.
Single-record wait lock
+100
S_WAIT_LOCK
Locks only one record at a time. If the record is already locked, the MicroKernel Engine retries the operation.
Single-record
no-wait lock
+200
S_NOWAIT_LOCK
Locks only one record at a time. If the record is already locked, the MicroKernel Engine returns an error status code.
Multiple-record wait lock
+300
M_WAIT_LOCK
Locks several records concurrently in the same file. If the record is already locked, the MicroKernel Engine retries the operation.
Multiple-record
no-wait lock
+400
M_NOWAIT_LOCK
Locks several records concurrently in the same file. If the record is already locked, the MicroKernel Engine returns an error status code.
No-wait page lock
+500
NOWRITE_WAIT
In a concurrent transaction, tells the MicroKernel Engine not to wait if the page to be changed has already been changed by another active concurrent transaction. This bias can be combined with any of the record locking biases (+100, +200, +300, or +400).