SnowPro Core Certification — Question 631
When can user session variables be accessed in a Snowflake scripting procedure?
Answer options
- A. When the procedure is defined as STRICT.
- B. When the procedure is defined to execute as CALLER.
- C. When the procedure is defined to execute as OWNER.
- D. When the procedure is defined with an argument that has the same name and type as the session variable.
Correct answer: B
Explanation
The correct answer is B because user session variables can be accessed when the procedure is executed in the context of the CALLER, allowing the procedure to access the caller's session variables. Options A and C are incorrect as they pertain to different execution contexts that do not allow access to session variables. Option D is also incorrect because having an argument with the same name and type does not automatically grant access to session variables.