From the course: Introduction to Modern Data Engineering with Snowflake

Unlock this course with a free trial

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

Complex procedural logic with stored procedures

Complex procedural logic with stored procedures - Snowflake Tutorial

From the course: Introduction to Modern Data Engineering with Snowflake

Complex procedural logic with stored procedures

Earlier, you used UDFs to perform very specific computations. They helped us perform conversions between units of measurement, and they scaled really well when we used them to derive new columns in a view. UDFs excel at this, but when you want to go beyond specific computations and perhaps capture and reuse more complex logic, then you might want to consider a stored procedure over a UDF. Before getting into the details of stored procedures, I'm sure you might be wondering what exactly constitutes more complex logic. Well, the exact specifics will, of course, depend on your use case. But generally speaking, store procedures might, for example, execute a series of operations that could include multiple SQL statements, transactional logic, or other complex workflows. For example, a stored procedure could be used to process an order, update inventory, generate reports, or maybe execute some other specific critical business logic. But the gist is that stored procedures are a set of…

Contents