B-Tree Comparison Functions

The HCL OneDB™ database server calls the following comparison operators when constructing B-tree indexes for opaque data types:
  • Equal() (=)
  • LessThan() (<)
  • LessThanOrEqual() (<=)
  • GreaterThan() (>)
  • GreaterThanOrEqual() (>=)
  • NotEqual() (!= and <>)
The C names of each of these functions are prefixed by the name of the opaque data type for which they are defined.
Important: The Equal() function is required if you use Visual Basic to develop a DataBlade® module.

BladeSmith generates the complete C code for these functions.

The generated code

For these functions, BladeSmith generates code that calls the Compare() function described in Compare function. For example, the Matrix2dEqual() function generated for the Matrix2d type calls the Matrix2dCompare() function, as follows:
/* Call Compare to perform the comparison. */

return (mi_boolean)(0 != Matrix2dCompare(Gen_param1, Gen_param2, Gen_fparam));

Customize the code

Do not modify these functions. You can, however, modify the Compare() function that these functions call.

Smart large object considerations

Because these functions call the Compare() function, they only evaluate the smart large object handles. You must customize the Compare() function to evaluate the actual contents of smart large objects.

Examples

The following example DataBlade modules contain some of the B-tree comparison functions:
  • Matrix DataBlade module
  • Circle DataBlade module
  • Shapes DataBlade module