v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-14106873.4 KB

Describes the details about a specific instance when a query was run by the Amazon Redshift Data API. The information includes when the query started, when it finished, the query status, the number of rows returned, and the SQL statement.

For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.

post/#X-Amz-Target=RedshiftData.DescribeStatement

Headers

X-Amz-Target'RedshiftData.DescribeStatement' required

Request body

Idstring required

The identifier of the SQL statement to describe. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. A suffix indicates the number of the SQL statement. For example, <code>d9b6c0c9-0747-4bf4-b142-e8883122f766:2</code> has a suffix of <code>:2</code> that indicates the second SQL statement of a batch query. This identifier is returned by <code>BatchExecuteStatment</code>, <code>ExecuteStatement</code>, and <code>ListStatements</code>.

Response

Success

ClusterIdentifierstring

The cluster identifier.

CreatedAtstring date-time

The date and time (UTC) when the SQL statement was submitted to run.

Databasestring

The name of the database.

DbUserstring

The database user name.

Durationinteger

The amount of time in nanoseconds that the statement ran.

Errorstring

The error message from the cluster if the SQL statement encountered an error while running.

HasResultSetboolean

A value that indicates whether the statement has a result set. The result set can be empty. The value is true for an empty result set. The value is true if any substatement returns a result set.

Idstring required

The identifier of the SQL statement described. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.

QueryStringstring

The SQL statement text.

RedshiftPidinteger

The process identifier from Amazon Redshift.

RedshiftQueryIdinteger

The identifier of the query generated by Amazon Redshift. These identifiers are also available in the <code>query</code> column of the <code>STL_QUERY</code> system view.

ResultRowsinteger

Either the number of rows returned from the SQL statement or the number of rows affected. If result size is greater than zero, the result rows can be the number of rows affected by SQL statements such as INSERT, UPDATE, DELETE, COPY, and others. A <code>-1</code> indicates the value is null.

ResultSizeinteger

The size in bytes of the returned results. A <code>-1</code> indicates the value is null.

SecretArnstring

The name or Amazon Resource Name (ARN) of the secret that enables access to the database.

Status'SUBMITTED' | 'PICKED' | 'STARTED' | 'FINISHED' | 'ABORTED' | 'FAILED' | 'ALL'
<p>The status of the SQL statement being described. Status values are defined as follows: </p> <ul> <li> <p>ABORTED - The query run was stopped by the user. </p> </li> <li> <p>ALL - A status value that includes all query statuses. This value can be used to filter results. </p> </li> <li> <p>FAILED - The query run failed. </p> </li> <li> <p>FINISHED - The query has finished running. </p> </li> <li> <p>PICKED - The query has been chosen to be run. </p> </li> <li> <p>STARTED - The query run has started. </p> </li> <li> <p>SUBMITTED - The query was submitted, but not yet processed. </p> </li> </ul>
UpdatedAtstring date-time

The date and time (UTC) that the metadata for the SQL statement was last updated. An example is the time the status last changed.

WorkgroupNamestring

The serverless workgroup name or Amazon Resource Name (ARN).