Examples: UDF code
These examples show how to implement UDF code by using SQL functions and external functions.
Example: Square of a number UDF
In this example, suppose that you want a function that returns the square of a number.
Example: Counter
Suppose you want to number the rows in your SELECT statement. So you write a UDF which increments and returns a counter.
Example: Weather table function
This is an example table function that returns weather information for various cities in the United States.
Parent topic:
Use user-defined functions (UDFs)