Categories:

Context functions (General)

IS_AGENT_ACTIVATED (SYS_CONTEXT function)

Returns the VARCHAR value 'TRUE' if an agent is active in the current execution context.

See also:

SYS_CONTEXT (SNOWFLAKE$CURRENT namespace)

Syntax

SYS_CONTEXT(
  'SNOWFLAKE$CURRENT' ,
  'IS_AGENT_ACTIVATED'
)

Arguments

'SNOWFLAKE$CURRENT'

Specifies that you want to call a function to return context information about the current execution context.

'IS_AGENT_ACTIVATED'

Calls the IS_AGENT_ACTIVATED function. This function takes no additional arguments and returns whether any agent is active in the current execution context.

Returns

The function returns one of the following VARCHAR values:

  • 'TRUE' if any agent is active in the current execution context.
  • 'FALSE' if no agent is active.

To compare this return value against the BOOLEAN value TRUE or FALSE, cast the return value to BOOLEAN. For example:

SELECT SYS_CONTEXT('SNOWFLAKE$CURRENT', 'IS_AGENT_ACTIVATED')::BOOLEAN = TRUE;

Examples

The following example checks whether any agent is active in the current execution context:

SELECT SYS_CONTEXT('SNOWFLAKE$CURRENT', 'IS_AGENT_ACTIVATED');