选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

GetStatementResultV2

聚焦模式
GetStatementResultV2 - Amazon Redshift Data API
此页面尚未翻译为您的语言。 请求翻译

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 in the Amazon Redshift Management Guide.

Request Syntax

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

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Note

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

Id

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

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

{ "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

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

The results of the SQL statement in CSV format.

Type: Array of QueryRecords objects

ColumnMetadata

The properties (metadata) of a column.

Type: Array of ColumnMetadata objects

NextToken

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

The data format of the result of the SQL statement.

Type: String

Valid Values: JSON | CSV

TotalNumRows

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

For information about the errors that are common to all actions, see Common Errors.

InternalServerException

The Amazon Redshift Data API operation failed due to invalid input.

HTTP Status Code: 500

ResourceNotFoundException

The Amazon Redshift Data API operation failed due to a missing resource.

HTTP Status Code: 400

ValidationException

The Amazon Redshift Data API operation failed due to invalid input.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。