From the course: Learning SnowflakeDB

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Create and use user-defined functions

Create and use user-defined functions - Snowflake Tutorial

From the course: Learning SnowflakeDB

Create and use user-defined functions

- [Instructor] Now in addition to supporting SQL queries, ANSI SQL, and some extensions, Snowflake supports user defined functions. And they're quite powerful. As with some of the deep topics, I'm going to get you started here, and if this is an area that you are going to use for your workload, I encourage you to go through the documentation, 'cause you have a lot of flexibility. So, a user defined function, of course, is a function that can be scaler or tabular. So scaler is one output row for each input. Tabular is a table function, and then there are different ways you can write this. You can write it in SQL. You can write it in JavaScript. You can write it in Java. Here's information about the limitations. So, the example that they show here is in SQL and it's a function that's the area of a circle and it uses pi, basically. And then it uses a query expression in the next example. And then it goes on to talk about…

Contents