
Answer-first summary for fast verification
Answer: Stored procedures can execute database operations while UDFs cannot.
Option A is correct because stored procedures in Snowflake can execute database operations (DML, DDL, etc.) while UDFs cannot - UDFs are limited to read-only operations and cannot modify the database state. This is explicitly stated in Snowflake documentation and confirmed by the community discussion with multiple upvoted comments. Option B is incorrect because stored procedures do not require returning a value (they can be void), while UDFs must return a value. Option C is incorrect because stored procedures cannot be used directly in SQL statements, while UDFs can. Option D is incorrect because multiple UDFs can be called in a single SQL statement, while stored procedures are called separately using CALL statements.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
What is the difference between a stored procedure and a User-Defined Function (UDF) in Snowflake?
A
Stored procedures can execute database operations while UDFs cannot.
B
Returning a value is required in a stored procedure while returning values in a UDF is optional.
C
Values returned by a stored procedure can be used directly in a SQL statement while the values returned by a UDF cannot.
D
Multiple stored procedures can be called as part of a single executable statement while a single SQL statement can only call one UDF at a time.