Specify overloaded routines during invocation
When you invoke an overloaded routine, you must specify an argument list for the routine. If you invoke an overloaded routine by the routine name only, the routine-resolution process fails because the database server cannot uniquely identify the routine without the arguments.
For example, the following SQL statement shows how
you can invoke the overloaded equal() function
on a new data type, udtype1:
CREATE TABLE atest (col1 udtype1, col2 udtype1, ...)
...
SELECT * FROM employee WHERE equal(col1, col2)
Because
the equal() function is an operator function bound
to the equal (=) symbol, you can also invoke the equal() function
with an argument on either side of the operator symbol, as follows:
SELECT * FROM employee WHERE col1 = col2
In
SPL, the following statements show ways that you can invoke the equal() function:
EXECUTE FUNCTION equal(col1, col2) INTO result
CALL equal(col1, col2) RETURNING result
LET result = equal(col1, col2)
For more information about overloaded operator functions, refer to Extend operators and built-in functions.