The Inter function

The SQL signature of the Inter support function must be:
Inter (UDT, UDT, UDT) RETURNS INTEGER

UDT refers to user-defined type, or the data type you want to index with the R-tree access method.

Write the Inter function to calculate the intersection of the bounding boxes of the objects in the first two parameters and to store the result in the third parameter. The R-tree access method uses the resulting bounding box in a subsequent call to the Size function to find out how much two bounding boxes overlap.

The return value of the Inter function is not used by the R-tree access method. The Inter function should call the mi_db_error_raise() DataBlade® API function to return errors.

For variable length UDTs, the third argument of the Inter function is not initialized; it contains a valid mi_lvarchar data type. You must set the size in the function to the size, in bytes, of the largest possible result.

For sample C code of the Inter function, see Inter support function. C code uses the DataBlade API to interact with the database server.