Creating a Table user-defined function using SQL
Snowflake provides capabilities for creating UDFs that can be used to extend the system and perform operations that are not available out of the box in Snowflake. Snowflake allows two languages for the creation of UDFs, SQL-based UDFs and JavaScript-based UDFs. Either of the UDF types can return scalar or table results.
In this recipe, we will be walking you through the creation of SQL-based Table UDFs and demonstrating how to call the UDFs in various scenarios. A Table UDF can return multiple rows of data.
Getting ready
You will need to be connected to your Snowflake instance via the Web UI or the SnowSQL client to execute this recipe.
How to do it
We will be creating a series of UDFs to demonstrate the SQL Table UDF capabilities provided by Snowflake. We will start by exploring some of the existing Table UDFs provided by Snowflake and reviewing their output:
- Let's start by creating a database in which...