The Equal function

The Equal function returns a Boolean value that indicates whether two objects are equal. For example, in two-dimensional space, two points that have the same coordinates might be equal, as are two circles that have the same center and radius.
Important: The meaning of “equality” between two spatial objects is often unclear, especially when floating point numbers are used. Bit-wise equality might be useful for eliminating duplicate data, but not much else. Application and data type designers need to define carefully what they mean when they say two spatial objects are equal. SQL requires that you define an Equal function for your data type so that SELECT UNIQUE queries can execute successfully.
The signature of the Equal function must be:
Equal (UDT, UDT) RETURNS BOOLEAN

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

The Equal function returns TRUE if the two objects contained in the two parameters are equal and FALSE otherwise. It is up to the application or data type designer to define what equal means for the user-defined data type.

Shapes3 sample DataBlade module contains sample C code to create an Equal function that takes the MyShape data type as its two parameters.


Copyright© 2019 HCL Technologies Limited