LIST QUERIES

Syntax

[ LIST | SHOW ] [ INTERACTIVE ] QUERIES
[ WITH ( list_parameter [, ... ] ) ];

Description

This command provides a list with a streaming or continuous query or queries submitted to the current organization, including any active interactive query.

See the USE command to change the organization from which to LIST QUERIES. When queries are terminated/STOPPED and cleaned up, DeltaStream removes them from the list of active queries.

Failed queries remain in the ERRORED state until they are explicitly terminated using the TERMINATE QUERY statement.

Note See RESTART QUERY for recovering from ERRORED queries.

Queries are listed only if the current role has USAGE privileges.

Arguments

WITH ( list_parameter [, ... ] )

This clause specifies List Parameters.

List Parameters

Parameter Name
Description

all

A flag that shows queries in any state, including terminated ones.

Required: No

Type: Flag

Examples

List active queries in the current organization

The following shows a list of queries that are active in the myorg organization:

List active interactive queries in a specific organization

The following lists interactive queries in a different organization, Shared org, using its unique identifier from the list of organizations the user owns:

Only active queries display in the list of queries. If the above interactive query is stopped, it is not returned in the list after it’s cleaned up:

List all interactive queries in the current organization

When a query is terminated and cleaned up, you can access it using the all parameter:

Last updated