Extending Snowflake with Functions and Procedures¶
You can extend the SQL you use in Snowflake by writing user-defined functions (UDFs) and stored procedures that you can call from SQL. When you write a UDF or procedure, you write its logic in one of the supported handler languages, then create it using SQL.
With a UDF, you typically calculate and return a value. With a stored procedure, you generally perform administrative operations by executing SQL statements.
You can also write an external function whose logic executes on a system external to Snowflake, such as a cloud provider.
- Choosing Whether to Write a Stored Procedure or a User-Defined Function
Choose between writing a stored procedure and writing a user-defined function.
- Design Guidelines and Constraints for Functions and Procedures
Read more about the guidelines that functions and procedures share, including guidelines related to deployment options, security practices, platform constraints, and conventions.
- Packaging Handler Code
Use tools to package handler code and ensure that dependencies are available on Snowflake.
- Stored Procedures Overview
Learn the benefits and supported languages.
- User-Defined Functions Overview
Learn the types of UDFs and supported languages.
- Introduction to External Functions
Access custom code that runs outside of Snowflake, such as API services that provide geocoding and machine learning models.