GetStatementResult - Redshift Data API Service

GetStatementResult

Fetches the temporarily cached result of an SQL statement. A token is returned to page through the statement results.

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. This identifier is returned by ExecuteStatment and ListStatements.

Type: String

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": [ [ { "blobValue": blob, "booleanValue": boolean, "doubleValue": number, "isNull": boolean, "longValue": number, "stringValue": "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.

Type: Array of arrays of Field 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

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 GetStatementResult 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: