Is there any way to get the owner schema for a stored procedure from within the executing procedure? For example, I have procedure declared as:
CREATE PROCEDURE UTIL.P_TEST()
EXECUTE AS CALLER
When I execute the procedure from within a different schema "NOT_UTIL":
USE NOT_UTIL;
CALL UTIL.P_TEST();
If I use the CURRENT_SCHEMA() function, I get the name of the schema for the current session "NOT_UTIL" (as-expected), What I need is to get the owner schema for the procedure: UTIL.
In TSQL, we can get the schema using this syntax:
OBJECT_SCHEMA_NAME(@@PROCID)
Is there any way to get this value from within a snowflake procedure? Please note that using the "EXECUTE AS OWNER" option is not a viable solution for this use-case.