- Categories:
System functions (System Information)
SYSTEM$DECODE_PAT¶
Returns information about a programmatic access token, given the secret for the token. This information includes the name of the token, the state of the token, and the user associated with the token.
You can call this function if you need to disable a programmatic access token and you want to know which user is associated with the token.
Syntax¶
SYSTEM$DECODE_PAT( '<secret_for_programmatic_access_token>' )
Arguments¶
'secret_for_programmatic_access_token'
Secret for the programmatic access token.
Returns¶
Returns a VARCHAR value containing the token information in a JSON object. The JSON object has the following fields:
Field |
Description |
---|---|
|
State of the programmatic access token. This field contains one of the following values:
|
|
Name of the programmatic access token. |
|
Name of the user associated with the programmatic access token. |
Examples¶
The following example returns information about the programmatic access token with the secret abC...Y5Z
:
SELECT SYSTEM$DECODE_PAT('abC...Y5Z');
+------------------------------------------------------------------------+
| SYSTEM$DECODE_PAT('☺☺☺...☺☺☺') |
|------------------------------------------------------------------------|
| {"STATE":"ACTIVE","PAT_NAME":"MY_EXAMPLE_TOKEN","USER_NAME":"MY_USER"} |
+------------------------------------------------------------------------+