CURRENT_SCHEMA
functionsupportedAccounts, users, sessions, warehousesReturns the name of the current schema, which varies depending on where you call the function: - If you call this function outside of a policy, UDF, or view, it returns the schema that is in use for the current session. - If you call this function in the body of a policy, for example a masking policy, it returns the schema that contains the table or view that is protected by the policy. - If you call this function in the handler code of a UDF, it returns the schema that contains the UDF. - If you call this function in the definition of a view, it returns the schema that contains the view.
Syntax
CURRENT_SCHEMA()
Usage notes
- Do not confuse this function with the similarly named function CURRENT_SCHEMAS.