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