BTRIEVE Functions


 

The Btrieve operation code determines the type of BTRIEVE function to perform. The operation may be a read, write, delete, update, or other function. The variable specified must be a Numeric Variable, an Expression, an Equated value, or a decimal value. The application program is responsible for specifying a valid {opcode} on every BTRIEVE instruction. The BTRIEVE record manager never changes {opcode}. The valid opcode values and the operations they perform are:

 

Code

Description

0

OPEN a file for further access.

1

CLOSE a previously opened file.

2

INSERT a new record into the file. This not only writes the text data butalso inserts all applicable keys. In standard PL/B code, this would be a WRITE operation followed by the required number of INSERT instructions (if additional index files existed).

3

UPDATE the current record in the file. As in the INSERT routine, the text data is updated and all applicable keys are updated (if necessary).

4

DELETE the current record from the file, including the text data and all keys. In standard PL/B, this would be a DELETE, followed by the required number of DELETEK instructions (if additional index files existed).

5

Get the record that meets the key specification given. This is equivalent to an ISAM read.

6

Get the next record (key sequentially) in the file. Equivalent to a READKS operation.

7

Get the previous record (key sequentially). In PL/B, this is would be a READKP instruction.

8

Get the record whose key value is greater than the specified key value. Equivalent to an ISAM READ (record found) followed by a READKS.

9

Get the record whose key value is equal to or greater than the specified key value.

10

Retrieve the record whose key value is less than the specified key value. Equivalent to an ISAM READ (record found) followed by a READKP.

11

Get the record whose key value is equivalent to or less than the specified key value.

12

Get the record with the first key value.

13

Get the record with the last key value.

14

Creates a BTRIEVE file with the specified characteristics. Unlike conventional PL/B, creating (PREP) of a file does not make it available for access. You must still OPEN the file before performing I/O against it.

15

Get status information about a file. Information is returned indicating the number of records and keys in the file.

16

Allows you to extend a BTRIEVE file across two logical or physical volumes. When you go to access the file, both portions of the file must be available.

17

Changes your current directory to the specified path.

18

Returns the path of your current directory.

19

Start a set of related operations. Indicates the start of a 'transaction'.

20

End the set of related operations. Indicates the end of a 'transaction'.

21

Aborts the current active 'transaction'. All operations performed since the start operation are removed from the file.

22

Return the position of the current record.

23

Retrieve the record at a specified position.

24

Get the record in the physical location following the current read.

25

Terminates the memory resident BTRIEVE file handler program at a workstation.

26

Retrieve the current BTRIEVE BREQUEST version and revision numbers.

27

Release a previously locked record.

28

Release all resources held by a workstation.

29

Sets the owner of a file, thus preventing unauthorized access.

30

Clears the owner of a file.

31

Create a supplemental index into a file.

32

Removes a supplemental index from a file.

+100/+300

Get a record and lock it after it becomes available. If the record is currently locked, the BTRIEVE record manager waits before returning.

+200/+400

Get a record and lock it. If already locked, a non-zero status is returned.

 

See Also: BTRIEVE

 



PL/B Language Reference