NEGATOR
Use the NEGATOR modifier with UDRs that return Boolean values.
The NEGATOR modifier designates another user-defined function, called a negator function, as a companion to the current function. A negator function takes the same arguments as its companion function, in the same order, but returns the Boolean complement.
That is, if a function returns
TRUE
for
a given set of arguments, its negator function returns FALSE
when
passed the same arguments, in the same order. For example, the following
functions are negator functions: equal(a,b)
notequal(a,b)
Both functions take the same arguments, in the same order, but return complementary Boolean values. When it is more efficient to do so, the query optimizer can use the negator function instead of the function that you specify.
To invoke a user-defined function that has a negator function, you must have the Execute privilege on both functions. In addition, the function must have the same owner as its negator function.