Extend operators and built-in functions

These topics discuss the operators and built-in functions that you can extend for use with UDTs. An operation is a task that the database server performs on one or more values.

The database server provides SQL-invoked functions that provide operations within SQL statements:
  • Operator symbols (such as +, -, /, and *) and their associated operator functions
  • Built-in functions such as cos() and abs()
  • Aggregate functions such as SUM and AVG

These functions handle the built-in data types. For a UDT to use any of these functions, you can write a new function that has the same name but accepts the UDT in its parameter list.

The property called routine overloading allows you to create a user-defined function whose name is already defined in the database but whose parameter list is different. All functions with the same name have the same functionality, but they operate on different data types.

For more information about routine overloading and routine resolution, refer to Understanding routine resolution. For information about aggregate functions, refer to Create user-defined aggregates.