

# Actions
<a name="API_Operations"></a>

The following actions are supported:
+  [BatchExecuteStatement](API_BatchExecuteStatement.md) 
+  [CancelStatement](API_CancelStatement.md) 
+  [DescribeStatement](API_DescribeStatement.md) 
+  [DescribeTable](API_DescribeTable.md) 
+  [ExecuteStatement](API_ExecuteStatement.md) 
+  [GetStatementResult](API_GetStatementResult.md) 
+  [GetStatementResultV2](API_GetStatementResultV2.md) 
+  [ListDatabases](API_ListDatabases.md) 
+  [ListSchemas](API_ListSchemas.md) 
+  [ListStatements](API_ListStatements.md) 
+  [ListTables](API_ListTables.md) 

# BatchExecuteStatement
<a name="API_BatchExecuteStatement"></a>

Runs one or more SQL statements, which can be data manipulation language (DML) or data definition language (DDL). Depending on the authorization method, use one of the following combinations of request parameters: 
+  AWS Secrets Manager - when connecting to a cluster, provide the `secret-arn` of a secret stored in AWS Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
+ Temporary credentials - when connecting to your data warehouse, choose one of the following options:
  + When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
  + When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
  + When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the `redshift:GetClusterCredentials` operation is required.

For more information about the Amazon Redshift Data API and AWS CLI usage examples, see [Using the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the *Amazon Redshift Management Guide*. 

## Request Syntax
<a name="API_BatchExecuteStatement_RequestSyntax"></a>

```
{
   "ClientToken": "string",
   "ClusterIdentifier": "string",
   "Database": "string",
   "DbUser": "string",
   "ResultFormat": "string",
   "SecretArn": "string",
   "SessionId": "string",
   "SessionKeepAliveSeconds": number,
   "Sqls": [ "string" ],
   "StatementName": "string",
   "WithEvent": boolean,
   "WorkgroupName": "string"
}
```

## Request Parameters
<a name="API_BatchExecuteStatement_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [Sqls](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-Sqls"></a>
One or more SQL statements to run. The SQL statements are run as a single transaction. They run serially in the order of the array. Subsequent SQL statements don't start until the previous statement in the array completes. If any SQL statement fails, then because they are run as one transaction, all work is rolled back.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 40 items.  
Required: Yes

 ** [ClientToken](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-ClientToken"></a>
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Required: No

 ** [ClusterIdentifier](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-ClusterIdentifier"></a>
The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either AWS Secrets Manager or temporary credentials.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 63.  
Required: No

 ** [Database](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-Database"></a>
The name of the database. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.   
Type: String  
Required: No

 ** [DbUser](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-DbUser"></a>
The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.   
Type: String  
Required: No

 ** [ResultFormat](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-ResultFormat"></a>
The data format of the result of the SQL statement. If no format is specified, the default is JSON.  
Type: String  
Valid Values: `JSON | CSV`   
Required: No

 ** [SecretArn](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-SecretArn"></a>
The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.   
Type: String  
Required: No

 ** [SessionId](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-SessionId"></a>
The session identifier of the query.  
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d+)?`   
Required: No

 ** [SessionKeepAliveSeconds](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-SessionKeepAliveSeconds"></a>
The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.  
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 86400.  
Required: No

 ** [StatementName](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-StatementName"></a>
The name of the SQL statements. You can name the SQL statements when you create them to identify the query.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 500.  
Required: No

 ** [WithEvent](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-WithEvent"></a>
A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statements run.   
Type: Boolean  
Required: No

 ** [WorkgroupName](#API_BatchExecuteStatement_RequestSyntax) **   <a name="redshiftdata-BatchExecuteStatement-request-WorkgroupName"></a>
The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either AWS Secrets Manager or temporary credentials.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 128.  
Pattern: `(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov|(-iso[a-z]?))?-[a-z]+-\d{1}:\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))`   
Required: No

## Response Syntax
<a name="API_BatchExecuteStatement_ResponseSyntax"></a>

```
{
   "ClusterIdentifier": "string",
   "CreatedAt": number,
   "Database": "string",
   "DbGroups": [ "string" ],
   "DbUser": "string",
   "Id": "string",
   "SecretArn": "string",
   "SessionId": "string",
   "WorkgroupName": "string"
}
```

## Response Elements
<a name="API_BatchExecuteStatement_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [ClusterIdentifier](#API_BatchExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-BatchExecuteStatement-response-ClusterIdentifier"></a>
The cluster identifier. This element is not returned when connecting to a serverless workgroup.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 63.

 ** [CreatedAt](#API_BatchExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-BatchExecuteStatement-response-CreatedAt"></a>
The date and time (UTC) the statement was created.   
Type: Timestamp

 ** [Database](#API_BatchExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-BatchExecuteStatement-response-Database"></a>
The name of the database.  
Type: String

 ** [DbGroups](#API_BatchExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-BatchExecuteStatement-response-DbGroups"></a>
A list of colon (:) separated names of database groups.  
Type: Array of strings

 ** [DbUser](#API_BatchExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-BatchExecuteStatement-response-DbUser"></a>
The database user name.  
Type: String

 ** [Id](#API_BatchExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-BatchExecuteStatement-response-Id"></a>
The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by `BatchExecuteStatment`.   
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d+)?` 

 ** [SecretArn](#API_BatchExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-BatchExecuteStatement-response-SecretArn"></a>
The name or ARN of the secret that enables access to the database.   
Type: String

 ** [SessionId](#API_BatchExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-BatchExecuteStatement-response-SessionId"></a>
The session identifier of the query.  
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d+)?` 

 ** [WorkgroupName](#API_BatchExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-BatchExecuteStatement-response-WorkgroupName"></a>
The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 128.  
Pattern: `(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov|(-iso[a-z]?))?-[a-z]+-\d{1}:\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))` 

## Errors
<a name="API_BatchExecuteStatement_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ActiveSessionsExceededException **   
The Amazon Redshift Data API operation failed because the maximum number of active sessions exceeded.  
HTTP Status Code: 400

 ** ActiveStatementsExceededException **   
The number of active statements exceeds the limit.  
HTTP Status Code: 400

 ** BatchExecuteStatementException **   
An SQL statement encountered an environmental error while running.    
 ** StatementId **   
Statement identifier of the exception.
HTTP Status Code: 500

 ** InternalServerException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 500

 ** ValidationException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 400

## See Also
<a name="API_BatchExecuteStatement_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/redshift-data-2019-12-20/BatchExecuteStatement) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-data-2019-12-20/BatchExecuteStatement) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/BatchExecuteStatement) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/redshift-data-2019-12-20/BatchExecuteStatement) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/BatchExecuteStatement) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/redshift-data-2019-12-20/BatchExecuteStatement) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/redshift-data-2019-12-20/BatchExecuteStatement) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/redshift-data-2019-12-20/BatchExecuteStatement) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/redshift-data-2019-12-20/BatchExecuteStatement) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/BatchExecuteStatement) 

# CancelStatement
<a name="API_CancelStatement"></a>

Cancels a running query. To be canceled, a query must be running. 

For more information about the Amazon Redshift Data API and AWS CLI usage examples, see [Using the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the *Amazon Redshift Management Guide*. 

## Request Syntax
<a name="API_CancelStatement_RequestSyntax"></a>

```
{
   "Id": "string"
}
```

## Request Parameters
<a name="API_CancelStatement_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [Id](#API_CancelStatement_RequestSyntax) **   <a name="redshiftdata-CancelStatement-request-Id"></a>
The identifier of the SQL statement to cancel. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by `BatchExecuteStatment`, `ExecuteStatment`, and `ListStatements`.   
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d+)?`   
Required: Yes

## Response Syntax
<a name="API_CancelStatement_ResponseSyntax"></a>

```
{
   "Status": boolean
}
```

## Response Elements
<a name="API_CancelStatement_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [Status](#API_CancelStatement_ResponseSyntax) **   <a name="redshiftdata-CancelStatement-response-Status"></a>
A value that indicates whether the cancel statement succeeded (true).   
Type: Boolean

## Errors
<a name="API_CancelStatement_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** DatabaseConnectionException **   
Connection to a database failed.  
HTTP Status Code: 500

 ** InternalServerException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The Amazon Redshift Data API operation failed due to a missing resource.     
 ** Message **   
The exception message.  
 ** ResourceId **   
Resource identifier associated with the exception.
HTTP Status Code: 400

 ** ValidationException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 400

## See Also
<a name="API_CancelStatement_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/redshift-data-2019-12-20/CancelStatement) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-data-2019-12-20/CancelStatement) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/CancelStatement) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/redshift-data-2019-12-20/CancelStatement) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/CancelStatement) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/redshift-data-2019-12-20/CancelStatement) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/redshift-data-2019-12-20/CancelStatement) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/redshift-data-2019-12-20/CancelStatement) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/redshift-data-2019-12-20/CancelStatement) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/CancelStatement) 

# DescribeStatement
<a name="API_DescribeStatement"></a>

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 AWS CLI usage examples, see [Using the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the *Amazon Redshift Management Guide*. 

## Request Syntax
<a name="API_DescribeStatement_RequestSyntax"></a>

```
{
   "Id": "string"
}
```

## Request Parameters
<a name="API_DescribeStatement_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [Id](#API_DescribeStatement_RequestSyntax) **   <a name="redshiftdata-DescribeStatement-request-Id"></a>
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, `d9b6c0c9-0747-4bf4-b142-e8883122f766:2` has a suffix of `:2` that indicates the second SQL statement of a batch query. This identifier is returned by `BatchExecuteStatment`, `ExecuteStatement`, and `ListStatements`.   
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d+)?`   
Required: Yes

## Response Syntax
<a name="API_DescribeStatement_ResponseSyntax"></a>

```
{
   "ClusterIdentifier": "string",
   "CreatedAt": number,
   "Database": "string",
   "DbUser": "string",
   "Duration": number,
   "Error": "string",
   "HasResultSet": boolean,
   "Id": "string",
   "QueryParameters": [ 
      { 
         "name": "string",
         "value": "string"
      }
   ],
   "QueryString": "string",
   "RedshiftPid": number,
   "RedshiftQueryId": number,
   "ResultFormat": "string",
   "ResultRows": number,
   "ResultSize": number,
   "SecretArn": "string",
   "SessionId": "string",
   "Status": "string",
   "SubStatements": [ 
      { 
         "CreatedAt": number,
         "Duration": number,
         "Error": "string",
         "HasResultSet": boolean,
         "Id": "string",
         "QueryString": "string",
         "RedshiftQueryId": number,
         "ResultRows": number,
         "ResultSize": number,
         "Status": "string",
         "UpdatedAt": number
      }
   ],
   "UpdatedAt": number,
   "WorkgroupName": "string"
}
```

## Response Elements
<a name="API_DescribeStatement_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [Id](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-Id"></a>
The identifier of the SQL statement described. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.   
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d+)?` 

 ** [ClusterIdentifier](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-ClusterIdentifier"></a>
The cluster identifier.   
Type: String

 ** [CreatedAt](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-CreatedAt"></a>
The date and time (UTC) when the SQL statement was submitted to run.   
Type: Timestamp

 ** [Database](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-Database"></a>
The name of the database.   
Type: String

 ** [DbUser](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-DbUser"></a>
The database user name.   
Type: String

 ** [Duration](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-Duration"></a>
The amount of time in nanoseconds that the statement ran.   
Type: Long

 ** [Error](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-Error"></a>
The error message from the cluster if the SQL statement encountered an error while running.   
Type: String

 ** [HasResultSet](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-HasResultSet"></a>
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.  
Type: Boolean

 ** [QueryParameters](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-QueryParameters"></a>
The parameters for the SQL statement.  
Type: Array of [SqlParameter](API_SqlParameter.md) objects  
Array Members: Minimum number of 1 item.

 ** [QueryString](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-QueryString"></a>
The SQL statement text.   
Type: String

 ** [RedshiftPid](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-RedshiftPid"></a>
The process identifier from Amazon Redshift.   
Type: Long

 ** [RedshiftQueryId](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-RedshiftQueryId"></a>
The identifier of the query generated by Amazon Redshift. These identifiers are also available in the `query` column of the `STL_QUERY` system view.   
Type: Long

 ** [ResultFormat](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-ResultFormat"></a>
The data format of the result of the SQL statement.  
Type: String  
Valid Values: `JSON | CSV` 

 ** [ResultRows](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-ResultRows"></a>
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 `-1` indicates the value is null.  
Type: Long

 ** [ResultSize](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-ResultSize"></a>
The size in bytes of the returned results. A `-1` indicates the value is null.  
Type: Long

 ** [SecretArn](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-SecretArn"></a>
The name or Amazon Resource Name (ARN) of the secret that enables access to the database.   
Type: String

 ** [SessionId](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-SessionId"></a>
The session identifier of the query.  
Type: String

 ** [Status](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-Status"></a>
The status of the SQL statement being described. Status values are defined as follows:   
+ ABORTED - The query run was stopped by the user. 
+ ALL - A status value that includes all query statuses. This value can be used to filter results. 
+ FAILED - The query run failed. 
+ FINISHED - The query has finished running. 
+ PICKED - The query has been chosen to be run. 
+ STARTED - The query run has started. 
+ SUBMITTED - The query was submitted, but not yet processed. 
Type: String  
Valid Values: `SUBMITTED | PICKED | STARTED | FINISHED | ABORTED | FAILED | ALL` 

 ** [SubStatements](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-SubStatements"></a>
The SQL statements from a multiple statement run.  
Type: Array of [SubStatementData](API_SubStatementData.md) objects

 ** [UpdatedAt](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-UpdatedAt"></a>
The date and time (UTC) that the metadata for the SQL statement was last updated. An example is the time the status last changed.   
Type: Timestamp

 ** [WorkgroupName](#API_DescribeStatement_ResponseSyntax) **   <a name="redshiftdata-DescribeStatement-response-WorkgroupName"></a>
The serverless workgroup name or Amazon Resource Name (ARN).  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 128.  
Pattern: `(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov|(-iso[a-z]?))?-[a-z]+-\d{1}:\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))` 

## Errors
<a name="API_DescribeStatement_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServerException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The Amazon Redshift Data API operation failed due to a missing resource.     
 ** Message **   
The exception message.  
 ** ResourceId **   
Resource identifier associated with the exception.
HTTP Status Code: 400

 ** ValidationException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 400

## See Also
<a name="API_DescribeStatement_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/redshift-data-2019-12-20/DescribeStatement) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-data-2019-12-20/DescribeStatement) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/DescribeStatement) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/redshift-data-2019-12-20/DescribeStatement) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/DescribeStatement) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/redshift-data-2019-12-20/DescribeStatement) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/redshift-data-2019-12-20/DescribeStatement) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/redshift-data-2019-12-20/DescribeStatement) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/redshift-data-2019-12-20/DescribeStatement) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/DescribeStatement) 

# DescribeTable
<a name="API_DescribeTable"></a>

Describes the detailed information about a table from metadata in the cluster. The information includes its columns. A token is returned to page through the column list. Depending on the authorization method, use one of the following combinations of request parameters: 
+  AWS Secrets Manager - when connecting to a cluster, provide the `secret-arn` of a secret stored in AWS Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
+ Temporary credentials - when connecting to your data warehouse, choose one of the following options:
  + When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
  + When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
  + When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the `redshift:GetClusterCredentials` operation is required.

For more information about the Amazon Redshift Data API and AWS CLI usage examples, see [Using the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the *Amazon Redshift Management Guide*. 

## Request Syntax
<a name="API_DescribeTable_RequestSyntax"></a>

```
{
   "ClusterIdentifier": "string",
   "ConnectedDatabase": "string",
   "Database": "string",
   "DbUser": "string",
   "MaxResults": number,
   "NextToken": "string",
   "Schema": "string",
   "SecretArn": "string",
   "Table": "string",
   "WorkgroupName": "string"
}
```

## Request Parameters
<a name="API_DescribeTable_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [Database](#API_DescribeTable_RequestSyntax) **   <a name="redshiftdata-DescribeTable-request-Database"></a>
The name of the database that contains the tables to be described. If `ConnectedDatabase` is not specified, this is also the database to connect to with your authentication credentials.  
Type: String  
Required: Yes

 ** [ClusterIdentifier](#API_DescribeTable_RequestSyntax) **   <a name="redshiftdata-DescribeTable-request-ClusterIdentifier"></a>
The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either AWS Secrets Manager or temporary credentials.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 63.  
Required: No

 ** [ConnectedDatabase](#API_DescribeTable_RequestSyntax) **   <a name="redshiftdata-DescribeTable-request-ConnectedDatabase"></a>
A database name. The connected database is specified when you connect with your authentication credentials.   
Type: String  
Required: No

 ** [DbUser](#API_DescribeTable_RequestSyntax) **   <a name="redshiftdata-DescribeTable-request-DbUser"></a>
The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.   
Type: String  
Required: No

 ** [MaxResults](#API_DescribeTable_RequestSyntax) **   <a name="redshiftdata-DescribeTable-request-MaxResults"></a>
The maximum number of tables to return in the response. If more tables exist than fit in one response, then `NextToken` is returned to page through the results.   
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 1000.  
Required: No

 ** [NextToken](#API_DescribeTable_RequestSyntax) **   <a name="redshiftdata-DescribeTable-request-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String  
Required: No

 ** [Schema](#API_DescribeTable_RequestSyntax) **   <a name="redshiftdata-DescribeTable-request-Schema"></a>
The schema that contains the table. If no schema is specified, then matching tables for all schemas are returned.   
Type: String  
Required: No

 ** [SecretArn](#API_DescribeTable_RequestSyntax) **   <a name="redshiftdata-DescribeTable-request-SecretArn"></a>
The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.   
Type: String  
Required: No

 ** [Table](#API_DescribeTable_RequestSyntax) **   <a name="redshiftdata-DescribeTable-request-Table"></a>
The table name. If no table is specified, then all tables for all matching schemas are returned. If no table and no schema is specified, then all tables for all schemas in the database are returned  
Type: String  
Required: No

 ** [WorkgroupName](#API_DescribeTable_RequestSyntax) **   <a name="redshiftdata-DescribeTable-request-WorkgroupName"></a>
The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either AWS Secrets Manager or temporary credentials.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 128.  
Pattern: `(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov|(-iso[a-z]?))?-[a-z]+-\d{1}:\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))`   
Required: No

## Response Syntax
<a name="API_DescribeTable_ResponseSyntax"></a>

```
{
   "ColumnList": [ 
      { 
         "columnDefault": "string",
         "isCaseSensitive": boolean,
         "isCurrency": boolean,
         "isSigned": boolean,
         "label": "string",
         "length": number,
         "name": "string",
         "nullable": number,
         "precision": number,
         "scale": number,
         "schemaName": "string",
         "tableName": "string",
         "typeName": "string"
      }
   ],
   "NextToken": "string",
   "TableName": "string"
}
```

## Response Elements
<a name="API_DescribeTable_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [ColumnList](#API_DescribeTable_ResponseSyntax) **   <a name="redshiftdata-DescribeTable-response-ColumnList"></a>
A list of columns in the table.   
Type: Array of [ColumnMetadata](API_ColumnMetadata.md) objects

 ** [NextToken](#API_DescribeTable_ResponseSyntax) **   <a name="redshiftdata-DescribeTable-response-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String

 ** [TableName](#API_DescribeTable_ResponseSyntax) **   <a name="redshiftdata-DescribeTable-response-TableName"></a>
The table name.   
Type: String

## Errors
<a name="API_DescribeTable_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** DatabaseConnectionException **   
Connection to a database failed.  
HTTP Status Code: 500

 ** InternalServerException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 500

 ** QueryTimeoutException **   
The Amazon Redshift Data API operation failed due to timeout.  
HTTP Status Code: 400

 ** ValidationException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 400

## See Also
<a name="API_DescribeTable_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/redshift-data-2019-12-20/DescribeTable) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-data-2019-12-20/DescribeTable) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/DescribeTable) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/redshift-data-2019-12-20/DescribeTable) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/DescribeTable) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/redshift-data-2019-12-20/DescribeTable) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/redshift-data-2019-12-20/DescribeTable) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/redshift-data-2019-12-20/DescribeTable) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/redshift-data-2019-12-20/DescribeTable) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/DescribeTable) 

# ExecuteStatement
<a name="API_ExecuteStatement"></a>

Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL). This statement must be a single SQL statement. Depending on the authorization method, use one of the following combinations of request parameters: 
+  AWS Secrets Manager - when connecting to a cluster, provide the `secret-arn` of a secret stored in AWS Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
+ Temporary credentials - when connecting to your data warehouse, choose one of the following options:
  + When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
  + When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
  + When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the `redshift:GetClusterCredentials` operation is required.

For more information about the Amazon Redshift Data API and AWS CLI usage examples, see [Using the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the *Amazon Redshift Management Guide*. 

## Request Syntax
<a name="API_ExecuteStatement_RequestSyntax"></a>

```
{
   "ClientToken": "string",
   "ClusterIdentifier": "string",
   "Database": "string",
   "DbUser": "string",
   "Parameters": [ 
      { 
         "name": "string",
         "value": "string"
      }
   ],
   "ResultFormat": "string",
   "SecretArn": "string",
   "SessionId": "string",
   "SessionKeepAliveSeconds": number,
   "Sql": "string",
   "StatementName": "string",
   "WithEvent": boolean,
   "WorkgroupName": "string"
}
```

## Request Parameters
<a name="API_ExecuteStatement_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [Sql](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-Sql"></a>
The SQL statement text to run.   
Type: String  
Required: Yes

 ** [ClientToken](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-ClientToken"></a>
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Required: No

 ** [ClusterIdentifier](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-ClusterIdentifier"></a>
The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either AWS Secrets Manager or temporary credentials.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 63.  
Required: No

 ** [Database](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-Database"></a>
The name of the database. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.   
Type: String  
Required: No

 ** [DbUser](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-DbUser"></a>
The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.   
Type: String  
Required: No

 ** [Parameters](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-Parameters"></a>
The parameters for the SQL statement.  
Type: Array of [SqlParameter](API_SqlParameter.md) objects  
Array Members: Minimum number of 1 item.  
Required: No

 ** [ResultFormat](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-ResultFormat"></a>
The data format of the result of the SQL statement. If no format is specified, the default is JSON.  
Type: String  
Valid Values: `JSON | CSV`   
Required: No

 ** [SecretArn](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-SecretArn"></a>
The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.   
Type: String  
Required: No

 ** [SessionId](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-SessionId"></a>
The session identifier of the query.  
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d+)?`   
Required: No

 ** [SessionKeepAliveSeconds](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-SessionKeepAliveSeconds"></a>
The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.  
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 86400.  
Required: No

 ** [StatementName](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-StatementName"></a>
The name of the SQL statement. You can name the SQL statement when you create it to identify the query.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 500.  
Required: No

 ** [WithEvent](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-WithEvent"></a>
A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.   
Type: Boolean  
Required: No

 ** [WorkgroupName](#API_ExecuteStatement_RequestSyntax) **   <a name="redshiftdata-ExecuteStatement-request-WorkgroupName"></a>
The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either AWS Secrets Manager or temporary credentials.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 128.  
Pattern: `(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov|(-iso[a-z]?))?-[a-z]+-\d{1}:\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))`   
Required: No

## Response Syntax
<a name="API_ExecuteStatement_ResponseSyntax"></a>

```
{
   "ClusterIdentifier": "string",
   "CreatedAt": number,
   "Database": "string",
   "DbGroups": [ "string" ],
   "DbUser": "string",
   "Id": "string",
   "SecretArn": "string",
   "SessionId": "string",
   "WorkgroupName": "string"
}
```

## Response Elements
<a name="API_ExecuteStatement_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [ClusterIdentifier](#API_ExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-ExecuteStatement-response-ClusterIdentifier"></a>
The cluster identifier. This element is not returned when connecting to a serverless workgroup.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 63.

 ** [CreatedAt](#API_ExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-ExecuteStatement-response-CreatedAt"></a>
The date and time (UTC) the statement was created.   
Type: Timestamp

 ** [Database](#API_ExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-ExecuteStatement-response-Database"></a>
The name of the database.  
Type: String

 ** [DbGroups](#API_ExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-ExecuteStatement-response-DbGroups"></a>
A list of colon (:) separated names of database groups.  
Type: Array of strings

 ** [DbUser](#API_ExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-ExecuteStatement-response-DbUser"></a>
The database user name.  
Type: String

 ** [Id](#API_ExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-ExecuteStatement-response-Id"></a>
The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.   
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d+)?` 

 ** [SecretArn](#API_ExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-ExecuteStatement-response-SecretArn"></a>
The name or ARN of the secret that enables access to the database.   
Type: String

 ** [SessionId](#API_ExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-ExecuteStatement-response-SessionId"></a>
The session identifier of the query.  
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d+)?` 

 ** [WorkgroupName](#API_ExecuteStatement_ResponseSyntax) **   <a name="redshiftdata-ExecuteStatement-response-WorkgroupName"></a>
The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 128.  
Pattern: `(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov|(-iso[a-z]?))?-[a-z]+-\d{1}:\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))` 

## Errors
<a name="API_ExecuteStatement_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ActiveSessionsExceededException **   
The Amazon Redshift Data API operation failed because the maximum number of active sessions exceeded.  
HTTP Status Code: 400

 ** ActiveStatementsExceededException **   
The number of active statements exceeds the limit.  
HTTP Status Code: 400

 ** ExecuteStatementException **   
The SQL statement encountered an environmental error while running.    
 ** Message **   
The exception message.  
 ** StatementId **   
Statement identifier of the exception.
HTTP Status Code: 500

 ** InternalServerException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 500

 ** ValidationException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 400

## See Also
<a name="API_ExecuteStatement_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/redshift-data-2019-12-20/ExecuteStatement) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-data-2019-12-20/ExecuteStatement) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/ExecuteStatement) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/redshift-data-2019-12-20/ExecuteStatement) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/ExecuteStatement) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/redshift-data-2019-12-20/ExecuteStatement) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/redshift-data-2019-12-20/ExecuteStatement) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/redshift-data-2019-12-20/ExecuteStatement) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/redshift-data-2019-12-20/ExecuteStatement) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/ExecuteStatement) 

# GetStatementResult
<a name="API_GetStatementResult"></a>

Fetches the temporarily cached result of an SQL statement in JSON format. The `ExecuteStatement` or `BatchExecuteStatement` operation that ran the SQL statement must have specified `ResultFormat` as `JSON` , or let the format default to JSON. A token is returned to page through the statement results.

For more information about the Amazon Redshift Data API and AWS CLI usage examples, see [Using the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the *Amazon Redshift Management Guide*. 

## Request Syntax
<a name="API_GetStatementResult_RequestSyntax"></a>

```
{
   "Id": "string",
   "NextToken": "string"
}
```

## Request Parameters
<a name="API_GetStatementResult_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [Id](#API_GetStatementResult_RequestSyntax) **   <a name="redshiftdata-GetStatementResult-request-Id"></a>
The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. A suffix indicates then number of the SQL statement. For example, `d9b6c0c9-0747-4bf4-b142-e8883122f766:2` has a suffix of `:2` that indicates the second SQL statement of a batch query. This identifier is returned by `BatchExecuteStatment`, `ExecuteStatment`, and `ListStatements`.   
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d+)?`   
Required: Yes

 ** [NextToken](#API_GetStatementResult_RequestSyntax) **   <a name="redshiftdata-GetStatementResult-request-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String  
Required: No

## Response Syntax
<a name="API_GetStatementResult_ResponseSyntax"></a>

```
{
   "ColumnMetadata": [ 
      { 
         "columnDefault": "string",
         "isCaseSensitive": boolean,
         "isCurrency": boolean,
         "isSigned": boolean,
         "label": "string",
         "length": number,
         "name": "string",
         "nullable": number,
         "precision": number,
         "scale": number,
         "schemaName": "string",
         "tableName": "string",
         "typeName": "string"
      }
   ],
   "NextToken": "string",
   "Records": [ 
      [ 
         { ... }
      ]
   ],
   "TotalNumRows": number
}
```

## Response Elements
<a name="API_GetStatementResult_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [Records](#API_GetStatementResult_ResponseSyntax) **   <a name="redshiftdata-GetStatementResult-response-Records"></a>
The results of the SQL statement in JSON format.  
Type: Array of arrays of [Field](API_Field.md) objects

 ** [ColumnMetadata](#API_GetStatementResult_ResponseSyntax) **   <a name="redshiftdata-GetStatementResult-response-ColumnMetadata"></a>
The properties (metadata) of a column.   
Type: Array of [ColumnMetadata](API_ColumnMetadata.md) objects

 ** [NextToken](#API_GetStatementResult_ResponseSyntax) **   <a name="redshiftdata-GetStatementResult-response-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String

 ** [TotalNumRows](#API_GetStatementResult_ResponseSyntax) **   <a name="redshiftdata-GetStatementResult-response-TotalNumRows"></a>
The total number of rows in the result set returned from a query. You can use this number to estimate the number of calls to the `GetStatementResult` operation needed to page through the results.   
Type: Long

## Errors
<a name="API_GetStatementResult_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServerException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The Amazon Redshift Data API operation failed due to a missing resource.     
 ** Message **   
The exception message.  
 ** ResourceId **   
Resource identifier associated with the exception.
HTTP Status Code: 400

 ** ValidationException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 400

## See Also
<a name="API_GetStatementResult_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/redshift-data-2019-12-20/GetStatementResult) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-data-2019-12-20/GetStatementResult) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/GetStatementResult) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/redshift-data-2019-12-20/GetStatementResult) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/GetStatementResult) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/redshift-data-2019-12-20/GetStatementResult) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/redshift-data-2019-12-20/GetStatementResult) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/redshift-data-2019-12-20/GetStatementResult) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/redshift-data-2019-12-20/GetStatementResult) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/GetStatementResult) 

# GetStatementResultV2
<a name="API_GetStatementResultV2"></a>

Fetches the temporarily cached result of an SQL statement in CSV format. The `ExecuteStatement` or `BatchExecuteStatement` operation that ran the SQL statement must have specified `ResultFormat` as `CSV`. A token is returned to page through the statement results.

For more information about the Amazon Redshift Data API and AWS CLI usage examples, see [Using the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the *Amazon Redshift Management Guide*. 

## Request Syntax
<a name="API_GetStatementResultV2_RequestSyntax"></a>

```
{
   "Id": "string",
   "NextToken": "string"
}
```

## Request Parameters
<a name="API_GetStatementResultV2_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [Id](#API_GetStatementResultV2_RequestSyntax) **   <a name="redshiftdata-GetStatementResultV2-request-Id"></a>
The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. A suffix indicates then number of the SQL statement. For example, `d9b6c0c9-0747-4bf4-b142-e8883122f766:2` has a suffix of `:2` that indicates the second SQL statement of a batch query. This identifier is returned by `BatchExecuteStatment`, `ExecuteStatment`, and `ListStatements`.   
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d+)?`   
Required: Yes

 ** [NextToken](#API_GetStatementResultV2_RequestSyntax) **   <a name="redshiftdata-GetStatementResultV2-request-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.  
Type: String  
Required: No

## Response Syntax
<a name="API_GetStatementResultV2_ResponseSyntax"></a>

```
{
   "ColumnMetadata": [ 
      { 
         "columnDefault": "string",
         "isCaseSensitive": boolean,
         "isCurrency": boolean,
         "isSigned": boolean,
         "label": "string",
         "length": number,
         "name": "string",
         "nullable": number,
         "precision": number,
         "scale": number,
         "schemaName": "string",
         "tableName": "string",
         "typeName": "string"
      }
   ],
   "NextToken": "string",
   "Records": [ 
      { ... }
   ],
   "ResultFormat": "string",
   "TotalNumRows": number
}
```

## Response Elements
<a name="API_GetStatementResultV2_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [Records](#API_GetStatementResultV2_ResponseSyntax) **   <a name="redshiftdata-GetStatementResultV2-response-Records"></a>
The results of the SQL statement in CSV format.  
Type: Array of [QueryRecords](API_QueryRecords.md) objects

 ** [ColumnMetadata](#API_GetStatementResultV2_ResponseSyntax) **   <a name="redshiftdata-GetStatementResultV2-response-ColumnMetadata"></a>
The properties (metadata) of a column.  
Type: Array of [ColumnMetadata](API_ColumnMetadata.md) objects

 ** [NextToken](#API_GetStatementResultV2_ResponseSyntax) **   <a name="redshiftdata-GetStatementResultV2-response-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String

 ** [ResultFormat](#API_GetStatementResultV2_ResponseSyntax) **   <a name="redshiftdata-GetStatementResultV2-response-ResultFormat"></a>
The data format of the result of the SQL statement.  
Type: String  
Valid Values: `JSON | CSV` 

 ** [TotalNumRows](#API_GetStatementResultV2_ResponseSyntax) **   <a name="redshiftdata-GetStatementResultV2-response-TotalNumRows"></a>
The total number of rows in the result set returned from a query. You can use this number to estimate the number of calls to the `GetStatementResultV2` operation needed to page through the results.   
Type: Long

## Errors
<a name="API_GetStatementResultV2_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServerException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The Amazon Redshift Data API operation failed due to a missing resource.     
 ** Message **   
The exception message.  
 ** ResourceId **   
Resource identifier associated with the exception.
HTTP Status Code: 400

 ** ValidationException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 400

## See Also
<a name="API_GetStatementResultV2_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/redshift-data-2019-12-20/GetStatementResultV2) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-data-2019-12-20/GetStatementResultV2) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/GetStatementResultV2) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/redshift-data-2019-12-20/GetStatementResultV2) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/GetStatementResultV2) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/redshift-data-2019-12-20/GetStatementResultV2) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/redshift-data-2019-12-20/GetStatementResultV2) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/redshift-data-2019-12-20/GetStatementResultV2) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/redshift-data-2019-12-20/GetStatementResultV2) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/GetStatementResultV2) 

# ListDatabases
<a name="API_ListDatabases"></a>

List the databases in a cluster. A token is returned to page through the database list. Depending on the authorization method, use one of the following combinations of request parameters: 
+  AWS Secrets Manager - when connecting to a cluster, provide the `secret-arn` of a secret stored in AWS Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
+ Temporary credentials - when connecting to your data warehouse, choose one of the following options:
  + When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
  + When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
  + When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the `redshift:GetClusterCredentials` operation is required.

For more information about the Amazon Redshift Data API and AWS CLI usage examples, see [Using the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the *Amazon Redshift Management Guide*. 

## Request Syntax
<a name="API_ListDatabases_RequestSyntax"></a>

```
{
   "ClusterIdentifier": "string",
   "Database": "string",
   "DbUser": "string",
   "MaxResults": number,
   "NextToken": "string",
   "SecretArn": "string",
   "WorkgroupName": "string"
}
```

## Request Parameters
<a name="API_ListDatabases_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [Database](#API_ListDatabases_RequestSyntax) **   <a name="redshiftdata-ListDatabases-request-Database"></a>
The name of the database. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.   
Type: String  
Required: Yes

 ** [ClusterIdentifier](#API_ListDatabases_RequestSyntax) **   <a name="redshiftdata-ListDatabases-request-ClusterIdentifier"></a>
The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either AWS Secrets Manager or temporary credentials.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 63.  
Required: No

 ** [DbUser](#API_ListDatabases_RequestSyntax) **   <a name="redshiftdata-ListDatabases-request-DbUser"></a>
The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.   
Type: String  
Required: No

 ** [MaxResults](#API_ListDatabases_RequestSyntax) **   <a name="redshiftdata-ListDatabases-request-MaxResults"></a>
The maximum number of databases to return in the response. If more databases exist than fit in one response, then `NextToken` is returned to page through the results.   
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 1000.  
Required: No

 ** [NextToken](#API_ListDatabases_RequestSyntax) **   <a name="redshiftdata-ListDatabases-request-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String  
Required: No

 ** [SecretArn](#API_ListDatabases_RequestSyntax) **   <a name="redshiftdata-ListDatabases-request-SecretArn"></a>
The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.   
Type: String  
Required: No

 ** [WorkgroupName](#API_ListDatabases_RequestSyntax) **   <a name="redshiftdata-ListDatabases-request-WorkgroupName"></a>
The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either AWS Secrets Manager or temporary credentials.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 128.  
Pattern: `(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov|(-iso[a-z]?))?-[a-z]+-\d{1}:\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))`   
Required: No

## Response Syntax
<a name="API_ListDatabases_ResponseSyntax"></a>

```
{
   "Databases": [ "string" ],
   "NextToken": "string"
}
```

## Response Elements
<a name="API_ListDatabases_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [Databases](#API_ListDatabases_ResponseSyntax) **   <a name="redshiftdata-ListDatabases-response-Databases"></a>
The names of databases.   
Type: Array of strings

 ** [NextToken](#API_ListDatabases_ResponseSyntax) **   <a name="redshiftdata-ListDatabases-response-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String

## Errors
<a name="API_ListDatabases_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** DatabaseConnectionException **   
Connection to a database failed.  
HTTP Status Code: 500

 ** InternalServerException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 500

 ** QueryTimeoutException **   
The Amazon Redshift Data API operation failed due to timeout.  
HTTP Status Code: 400

 ** ValidationException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 400

## See Also
<a name="API_ListDatabases_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/redshift-data-2019-12-20/ListDatabases) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-data-2019-12-20/ListDatabases) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/ListDatabases) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/redshift-data-2019-12-20/ListDatabases) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/ListDatabases) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/redshift-data-2019-12-20/ListDatabases) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/redshift-data-2019-12-20/ListDatabases) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/redshift-data-2019-12-20/ListDatabases) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/redshift-data-2019-12-20/ListDatabases) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/ListDatabases) 

# ListSchemas
<a name="API_ListSchemas"></a>

Lists the schemas in a database. A token is returned to page through the schema list. Depending on the authorization method, use one of the following combinations of request parameters: 
+  AWS Secrets Manager - when connecting to a cluster, provide the `secret-arn` of a secret stored in AWS Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
+ Temporary credentials - when connecting to your data warehouse, choose one of the following options:
  + When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
  + When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
  + When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the `redshift:GetClusterCredentials` operation is required.

For more information about the Amazon Redshift Data API and AWS CLI usage examples, see [Using the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the *Amazon Redshift Management Guide*. 

## Request Syntax
<a name="API_ListSchemas_RequestSyntax"></a>

```
{
   "ClusterIdentifier": "string",
   "ConnectedDatabase": "string",
   "Database": "string",
   "DbUser": "string",
   "MaxResults": number,
   "NextToken": "string",
   "SchemaPattern": "string",
   "SecretArn": "string",
   "WorkgroupName": "string"
}
```

## Request Parameters
<a name="API_ListSchemas_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [Database](#API_ListSchemas_RequestSyntax) **   <a name="redshiftdata-ListSchemas-request-Database"></a>
The name of the database that contains the schemas to list. If `ConnectedDatabase` is not specified, this is also the database to connect to with your authentication credentials.  
Type: String  
Required: Yes

 ** [ClusterIdentifier](#API_ListSchemas_RequestSyntax) **   <a name="redshiftdata-ListSchemas-request-ClusterIdentifier"></a>
The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either AWS Secrets Manager or temporary credentials.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 63.  
Required: No

 ** [ConnectedDatabase](#API_ListSchemas_RequestSyntax) **   <a name="redshiftdata-ListSchemas-request-ConnectedDatabase"></a>
A database name. The connected database is specified when you connect with your authentication credentials.   
Type: String  
Required: No

 ** [DbUser](#API_ListSchemas_RequestSyntax) **   <a name="redshiftdata-ListSchemas-request-DbUser"></a>
The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.   
Type: String  
Required: No

 ** [MaxResults](#API_ListSchemas_RequestSyntax) **   <a name="redshiftdata-ListSchemas-request-MaxResults"></a>
The maximum number of schemas to return in the response. If more schemas exist than fit in one response, then `NextToken` is returned to page through the results.   
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 1000.  
Required: No

 ** [NextToken](#API_ListSchemas_RequestSyntax) **   <a name="redshiftdata-ListSchemas-request-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String  
Required: No

 ** [SchemaPattern](#API_ListSchemas_RequestSyntax) **   <a name="redshiftdata-ListSchemas-request-SchemaPattern"></a>
A pattern to filter results by schema name. Within a schema pattern, "%" means match any substring of 0 or more characters and "\$1" means match any one character. Only schema name entries matching the search pattern are returned.   
Type: String  
Required: No

 ** [SecretArn](#API_ListSchemas_RequestSyntax) **   <a name="redshiftdata-ListSchemas-request-SecretArn"></a>
The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.   
Type: String  
Required: No

 ** [WorkgroupName](#API_ListSchemas_RequestSyntax) **   <a name="redshiftdata-ListSchemas-request-WorkgroupName"></a>
The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either AWS Secrets Manager or temporary credentials.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 128.  
Pattern: `(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov|(-iso[a-z]?))?-[a-z]+-\d{1}:\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))`   
Required: No

## Response Syntax
<a name="API_ListSchemas_ResponseSyntax"></a>

```
{
   "NextToken": "string",
   "Schemas": [ "string" ]
}
```

## Response Elements
<a name="API_ListSchemas_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [NextToken](#API_ListSchemas_ResponseSyntax) **   <a name="redshiftdata-ListSchemas-response-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String

 ** [Schemas](#API_ListSchemas_ResponseSyntax) **   <a name="redshiftdata-ListSchemas-response-Schemas"></a>
The schemas that match the request pattern.   
Type: Array of strings

## Errors
<a name="API_ListSchemas_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** DatabaseConnectionException **   
Connection to a database failed.  
HTTP Status Code: 500

 ** InternalServerException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 500

 ** QueryTimeoutException **   
The Amazon Redshift Data API operation failed due to timeout.  
HTTP Status Code: 400

 ** ValidationException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 400

## See Also
<a name="API_ListSchemas_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/redshift-data-2019-12-20/ListSchemas) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-data-2019-12-20/ListSchemas) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/ListSchemas) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/redshift-data-2019-12-20/ListSchemas) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/ListSchemas) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/redshift-data-2019-12-20/ListSchemas) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/redshift-data-2019-12-20/ListSchemas) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/redshift-data-2019-12-20/ListSchemas) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/redshift-data-2019-12-20/ListSchemas) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/ListSchemas) 

# ListStatements
<a name="API_ListStatements"></a>

List of SQL statements. By default, only finished statements are shown. A token is returned to page through the statement list. 

When you use identity-enhanced role sessions to list statements, you must provide either the `cluster-identifier` or `workgroup-name` parameter. This ensures that the IdC user can only access the Amazon Redshift IdC applications they are assigned. For more information, see [ Trusted identity propagation overview](https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation-overview.html).

For more information about the Amazon Redshift Data API and AWS CLI usage examples, see [Using the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the *Amazon Redshift Management Guide*. 

## Request Syntax
<a name="API_ListStatements_RequestSyntax"></a>

```
{
   "ClusterIdentifier": "string",
   "Database": "string",
   "MaxResults": number,
   "NextToken": "string",
   "RoleLevel": boolean,
   "StatementName": "string",
   "Status": "string",
   "WorkgroupName": "string"
}
```

## Request Parameters
<a name="API_ListStatements_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [ClusterIdentifier](#API_ListStatements_RequestSyntax) **   <a name="redshiftdata-ListStatements-request-ClusterIdentifier"></a>
The cluster identifier. Only statements that ran on this cluster are returned. When providing `ClusterIdentifier`, then `WorkgroupName` can't be specified.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 63.  
Required: No

 ** [Database](#API_ListStatements_RequestSyntax) **   <a name="redshiftdata-ListStatements-request-Database"></a>
The name of the database when listing statements run against a `ClusterIdentifier` or `WorkgroupName`.   
Type: String  
Required: No

 ** [MaxResults](#API_ListStatements_RequestSyntax) **   <a name="redshiftdata-ListStatements-request-MaxResults"></a>
The maximum number of SQL statements to return in the response. If more SQL statements exist than fit in one response, then `NextToken` is returned to page through the results.   
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 100.  
Required: No

 ** [NextToken](#API_ListStatements_RequestSyntax) **   <a name="redshiftdata-ListStatements-request-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String  
Required: No

 ** [RoleLevel](#API_ListStatements_RequestSyntax) **   <a name="redshiftdata-ListStatements-request-RoleLevel"></a>
A value that filters which statements to return in the response. If true, all statements run by the caller's IAM role are returned. If false, only statements run by the caller's IAM role in the current IAM session are returned. The default is true.   
Type: Boolean  
Required: No

 ** [StatementName](#API_ListStatements_RequestSyntax) **   <a name="redshiftdata-ListStatements-request-StatementName"></a>
The name of the SQL statement specified as input to `BatchExecuteStatement` or `ExecuteStatement` to identify the query. You can list multiple statements by providing a prefix that matches the beginning of the statement name. For example, to list myStatement1, myStatement2, myStatement3, and so on, then provide the a value of `myStatement`. Data API does a case-sensitive match of SQL statement names to the prefix value you provide.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 500.  
Required: No

 ** [Status](#API_ListStatements_RequestSyntax) **   <a name="redshiftdata-ListStatements-request-Status"></a>
The status of the SQL statement to list. Status values are defined as follows:   
+ ABORTED - The query run was stopped by the user. 
+ ALL - A status value that includes all query statuses. This value can be used to filter results. 
+ FAILED - The query run failed. 
+ FINISHED - The query has finished running. 
+ PICKED - The query has been chosen to be run. 
+ STARTED - The query run has started. 
+ SUBMITTED - The query was submitted, but not yet processed. 
Type: String  
Valid Values: `SUBMITTED | PICKED | STARTED | FINISHED | ABORTED | FAILED | ALL`   
Required: No

 ** [WorkgroupName](#API_ListStatements_RequestSyntax) **   <a name="redshiftdata-ListStatements-request-WorkgroupName"></a>
The serverless workgroup name or Amazon Resource Name (ARN). Only statements that ran on this workgroup are returned. When providing `WorkgroupName`, then `ClusterIdentifier` can't be specified.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 128.  
Pattern: `(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov|(-iso[a-z]?))?-[a-z]+-\d{1}:\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))`   
Required: No

## Response Syntax
<a name="API_ListStatements_ResponseSyntax"></a>

```
{
   "NextToken": "string",
   "Statements": [ 
      { 
         "CreatedAt": number,
         "Id": "string",
         "IsBatchStatement": boolean,
         "QueryParameters": [ 
            { 
               "name": "string",
               "value": "string"
            }
         ],
         "QueryString": "string",
         "QueryStrings": [ "string" ],
         "ResultFormat": "string",
         "SecretArn": "string",
         "SessionId": "string",
         "StatementName": "string",
         "Status": "string",
         "UpdatedAt": number
      }
   ]
}
```

## Response Elements
<a name="API_ListStatements_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [Statements](#API_ListStatements_ResponseSyntax) **   <a name="redshiftdata-ListStatements-response-Statements"></a>
The SQL statements.   
Type: Array of [StatementData](API_StatementData.md) objects

 ** [NextToken](#API_ListStatements_ResponseSyntax) **   <a name="redshiftdata-ListStatements-response-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String

## Errors
<a name="API_ListStatements_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServerException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 500

 ** ValidationException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 400

## See Also
<a name="API_ListStatements_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/redshift-data-2019-12-20/ListStatements) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-data-2019-12-20/ListStatements) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/ListStatements) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/redshift-data-2019-12-20/ListStatements) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/ListStatements) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/redshift-data-2019-12-20/ListStatements) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/redshift-data-2019-12-20/ListStatements) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/redshift-data-2019-12-20/ListStatements) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/redshift-data-2019-12-20/ListStatements) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/ListStatements) 

# ListTables
<a name="API_ListTables"></a>

List the tables in a database. If neither `SchemaPattern` nor `TablePattern` are specified, then all tables in the database are returned. A token is returned to page through the table list. Depending on the authorization method, use one of the following combinations of request parameters: 
+  AWS Secrets Manager - when connecting to a cluster, provide the `secret-arn` of a secret stored in AWS Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
+ Temporary credentials - when connecting to your data warehouse, choose one of the following options:
  + When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
  + When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, `arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
  + When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the `redshift:GetClusterCredentials` operation is required.

For more information about the Amazon Redshift Data API and AWS CLI usage examples, see [Using the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the *Amazon Redshift Management Guide*. 

## Request Syntax
<a name="API_ListTables_RequestSyntax"></a>

```
{
   "ClusterIdentifier": "string",
   "ConnectedDatabase": "string",
   "Database": "string",
   "DbUser": "string",
   "MaxResults": number,
   "NextToken": "string",
   "SchemaPattern": "string",
   "SecretArn": "string",
   "TablePattern": "string",
   "WorkgroupName": "string"
}
```

## Request Parameters
<a name="API_ListTables_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [Database](#API_ListTables_RequestSyntax) **   <a name="redshiftdata-ListTables-request-Database"></a>
The name of the database that contains the tables to list. If `ConnectedDatabase` is not specified, this is also the database to connect to with your authentication credentials.  
Type: String  
Required: Yes

 ** [ClusterIdentifier](#API_ListTables_RequestSyntax) **   <a name="redshiftdata-ListTables-request-ClusterIdentifier"></a>
The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either AWS Secrets Manager or temporary credentials.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 63.  
Required: No

 ** [ConnectedDatabase](#API_ListTables_RequestSyntax) **   <a name="redshiftdata-ListTables-request-ConnectedDatabase"></a>
A database name. The connected database is specified when you connect with your authentication credentials.   
Type: String  
Required: No

 ** [DbUser](#API_ListTables_RequestSyntax) **   <a name="redshiftdata-ListTables-request-DbUser"></a>
The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.   
Type: String  
Required: No

 ** [MaxResults](#API_ListTables_RequestSyntax) **   <a name="redshiftdata-ListTables-request-MaxResults"></a>
The maximum number of tables to return in the response. If more tables exist than fit in one response, then `NextToken` is returned to page through the results.   
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 1000.  
Required: No

 ** [NextToken](#API_ListTables_RequestSyntax) **   <a name="redshiftdata-ListTables-request-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String  
Required: No

 ** [SchemaPattern](#API_ListTables_RequestSyntax) **   <a name="redshiftdata-ListTables-request-SchemaPattern"></a>
A pattern to filter results by schema name. Within a schema pattern, "%" means match any substring of 0 or more characters and "\$1" means match any one character. Only schema name entries matching the search pattern are returned. If `SchemaPattern` is not specified, then all tables that match `TablePattern` are returned. If neither `SchemaPattern` or `TablePattern` are specified, then all tables are returned.   
Type: String  
Required: No

 ** [SecretArn](#API_ListTables_RequestSyntax) **   <a name="redshiftdata-ListTables-request-SecretArn"></a>
The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.   
Type: String  
Required: No

 ** [TablePattern](#API_ListTables_RequestSyntax) **   <a name="redshiftdata-ListTables-request-TablePattern"></a>
A pattern to filter results by table name. Within a table pattern, "%" means match any substring of 0 or more characters and "\$1" means match any one character. Only table name entries matching the search pattern are returned. If `TablePattern` is not specified, then all tables that match `SchemaPattern`are returned. If neither `SchemaPattern` or `TablePattern` are specified, then all tables are returned.   
Type: String  
Required: No

 ** [WorkgroupName](#API_ListTables_RequestSyntax) **   <a name="redshiftdata-ListTables-request-WorkgroupName"></a>
The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either AWS Secrets Manager or temporary credentials.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 128.  
Pattern: `(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov|(-iso[a-z]?))?-[a-z]+-\d{1}:\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))`   
Required: No

## Response Syntax
<a name="API_ListTables_ResponseSyntax"></a>

```
{
   "NextToken": "string",
   "Tables": [ 
      { 
         "name": "string",
         "schema": "string",
         "type": "string"
      }
   ]
}
```

## Response Elements
<a name="API_ListTables_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [NextToken](#API_ListTables_ResponseSyntax) **   <a name="redshiftdata-ListTables-response-NextToken"></a>
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.   
Type: String

 ** [Tables](#API_ListTables_ResponseSyntax) **   <a name="redshiftdata-ListTables-response-Tables"></a>
The tables that match the request pattern.   
Type: Array of [TableMember](API_TableMember.md) objects

## Errors
<a name="API_ListTables_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** DatabaseConnectionException **   
Connection to a database failed.  
HTTP Status Code: 500

 ** InternalServerException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 500

 ** QueryTimeoutException **   
The Amazon Redshift Data API operation failed due to timeout.  
HTTP Status Code: 400

 ** ValidationException **   
The Amazon Redshift Data API operation failed due to invalid input.     
 ** Message **   
The exception message.
HTTP Status Code: 400

## See Also
<a name="API_ListTables_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/redshift-data-2019-12-20/ListTables) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-data-2019-12-20/ListTables) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/ListTables) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/redshift-data-2019-12-20/ListTables) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/ListTables) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/redshift-data-2019-12-20/ListTables) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/redshift-data-2019-12-20/ListTables) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/redshift-data-2019-12-20/ListTables) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/redshift-data-2019-12-20/ListTables) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/ListTables) 