Categories:

This table function returns the list of child tasks for a given root (i.e. parent) task in a simple tree of tasks.

## Syntax¶

TASK_DEPENDENTS(
[, RECURSIVE => <Boolean> ] )


## Arguments¶

TASK_NAME => 'string'

A string specifying a task. The function returns the specified root task as the first entry, followed by the list of child tasks.

• Note that the entire name must be enclosed in single quotes, including the database and schema (if the name is fully-qualified), i.e. '<db>.<schema>.<task_name>'.

• If the task name is case-sensitive or includes any special characters or spaces, double quotes are required to process the case/characters. The double quotes must be enclosed within the single quotes, i.e. '"<task_name>"'.

RECURSIVE => Boolean

Specifies whether to limit the output to include only direct child tasks or to include all recursive child tasks.

Values

TRUE: Returns all recursive child tasks (children, grandchildren, etc.) in the output.

FALSE: Returns only direct child tasks in the output.

Default: TRUE.

## Usage Notes¶

• Only returns rows for a task owner (i.e. the role with the OWNERSHIP privilege on a task) or a role with either the MONITOR or OPERATE privilege on a task.

• When calling an Information Schema table function, the session must have an INFORMATION_SCHEMA schema in use or the function name must be fully-qualified. For more details, see Information Schema.

## Output¶

The function output provides table properties and metadata in the following columns:

| created_on | name | database_name | schema_name | comment | warehouse | schedule | state | definition | condition


Column

Description

created_on

Date and time when the task was created.

name

database_name

Database for the schema for the task.

schema_name

owner

Role that owns the task (i.e. has the OWNERSHIP privilege on the task)

comment

warehouse

Warehouse that provides the required resources to run the task.

schedule

Schedule for running the task. Displays NULL if no schedule is specified.

predecessor

state

‘Started’ or ‘Suspended’ based on the current state of the task.

definition

SQL statements executed when the task runs.

condition

Condition specified in the WHEN clause for the task.

## Examples¶

Retrieve the list of direct child tasks for the mydb.myschema.mytask task:

select *