Categories:

Context functions (Session Object)

CURRENT_ROLE_TYPE

Calling the CURRENT_ROLE_TYPE function returns ROLE if the current active (primary) role in the session is an account role. Calling the CURRENT_ROLE_TYPE function from a session running inside a Snowflake native application returns APPLICATION_INSTANCE.

Syntax

CURRENT_ROLE_TYPE()
Copy

Arguments

None.

Usage notes

The primary role in a session cannot be a database role. Therefore, this functions will never return DATABASE_ROLE.

None.

Examples

SELECT CURRENT_ROLE_TYPE();

+---------------------+
| CURRENT_ROLE_TYPE() |
|---------------------|
| ROLE                |
+---------------------+
Copy
Language: English