BTRIEVE


8.0.5

 

BTRIEVE is a ready-made record management system that allows you to ignore physical file structures and concentrate on the logical structure of a file. Sunbelt's implementation of BTRIEVE allows execution of all BTRIEVE FUNCTIONs by the PL/B program. BTRIEVE is not supported in the Linux runtimes. Features and benefits of BTRIEVE include:
Each data file may have up to 24 key fields or access paths. BTRIEVE maintains separate internal indexes for each access path.

 

The instruction uses the following format:

 

 

[label]

BTRIEVE

{opcode},{status},{bfile}:

 

 

 

{buffer},{length},{key},{keynum}

 

Where:

label

Optional. A Program Execution Label.

opcode

Required. A previously defined Numeric Variable or Expression representing the Btrieve FUNCTION Code.

status

Required. A previously defined Numeric Variable returning the Btrieve status code (0 = Successful).

bfile

Required. A previously defined BFILE definition label.

buffer

Required. A previously defined Character String Variable or SKIP directive indicating the beginning of the input or output buffer space for BTRIEVE file I/O.

length

Required. A previously defined Numeric Variable or Expression representing the amount of data sent to or received from Btrieve.

key

Required. A previously defined Character String Variable representing a key value sent to or received from BTRIEVE.

keynum

Required. A previously defined Numeric Variable or representing the amount of data sent to or received from Btrieve.

Flags Affected: OVER

Note the following:

  1. All calls to the BTRIEVE record manager return a status value. This value is placed in the variable {status}. You should always check the value of {status} after every BTRIEVE instruction. {status} is always a return value from BTRIEVE.

  2. {bfile} is the BFILE declaration previously declared in the user data area. Its contents are initialized upon execution of a BTRIEVE OPEN operation. The BTRIEVE record manager references and updates this upon all file operations. Your application program must allocate a separate BFILE declaration for each BTRIEVE file it opens. Unlike conventional PL/B ISAM file I/O, if you have multiple indexes, you must only have one BFILE definition and thus execute only one open operation.

  3. All data transferred from and to the BTRIEVE record manager use the {buffer} area. This is an area from 1 to n bytes in length (with 'n' not to exceed the maximum allowed by BTRIEVE). {buffer} must be a valid DIM or INIT variable and indicates the starting point of the total buffer. It is recommended {buffer} be setup using the SKIP parameter. {buffer} may be both a sending and receiving variable for BTRIEVE.

  4. The actual amount of data passed from {buffer} to BTRIEVE or received from BTRIEVE is determined by {length}.

  5. Dependent on the particular operation, {key} is the key value to or from the BTRIEVE record manager. {key} is both a sending and receiving variable for BTRIEVE.

  6. You may have up to 24 different keys for each BTRIEVE file. {keynum} tells the BTRIEVE record manager that access path to follow for this particular operation. {keynum} is a FORM variable, INTEGER variable, an immediate value or an EQUated value with a range from 0 to 23. The BTRIEVE record manager does not alter the {keynum} field. {keynum} is an input field only for BTRIEVE and has other purposes for some of the BTRIEVE operations. See the BTRIEVE manual for more details.

  7. The OVER flag is set if the BTRIEVE record manager cannot be accessed (i.e., BREQUEST has not been loaded for a workstation.

  8. Network versions of BTRIEVE are not supported with SUNDB86L.

 

 

See Also: Example Code, Disk I/O Instructions

 



PL/B Language Reference Windows Drive Substitution CLOSE