get_statement_result
(**kwargs)¶Fetches the temporarily cached result of an SQL statement. A token is returned to page through the statement results.
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_statement_result(
Id='string',
NextToken='string'
)
[REQUIRED]
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
.
dict
Response Syntax
{
'ColumnMetadata': [
{
'columnDefault': 'string',
'isCaseSensitive': True|False,
'isCurrency': True|False,
'isSigned': True|False,
'label': 'string',
'length': 123,
'name': 'string',
'nullable': 123,
'precision': 123,
'scale': 123,
'schemaName': 'string',
'tableName': 'string',
'typeName': 'string'
},
],
'NextToken': 'string',
'Records': [
[
{
'blobValue': b'bytes',
'booleanValue': True|False,
'doubleValue': 123.0,
'isNull': True|False,
'longValue': 123,
'stringValue': 'string'
},
],
],
'TotalNumRows': 123
}
Response Structure
(dict) --
ColumnMetadata (list) --
The properties (metadata) of a column.
(dict) --
The properties (metadata) of a column.
columnDefault (string) --
The default value of the column.
isCaseSensitive (boolean) --
A value that indicates whether the column is case-sensitive.
isCurrency (boolean) --
A value that indicates whether the column contains currency values.
isSigned (boolean) --
A value that indicates whether an integer column is signed.
label (string) --
The label for the column.
length (integer) --
The length of the column.
name (string) --
The name of the column.
nullable (integer) --
A value that indicates whether the column is nullable.
precision (integer) --
The precision value of a decimal number column.
scale (integer) --
The scale value of a decimal number column.
schemaName (string) --
The name of the schema that contains the table that includes the column.
tableName (string) --
The name of the table that includes the column.
typeName (string) --
The database-specific data type of the column.
NextToken (string) --
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.
Records (list) --
The results of the SQL statement.
(list) --
(dict) --
A data value in a column.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: blobValue
, booleanValue
, doubleValue
, isNull
, longValue
, stringValue
. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER
as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER
is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
blobValue (bytes) --
A value of the BLOB data type.
booleanValue (boolean) --
A value of the Boolean data type.
doubleValue (float) --
A value of the double data type.
isNull (boolean) --
A value that indicates whether the data is NULL.
longValue (integer) --
A value of the long data type.
stringValue (string) --
A value of the string data type.
TotalNumRows (integer) --
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.
Exceptions
RedshiftDataAPIService.Client.exceptions.ValidationException
RedshiftDataAPIService.Client.exceptions.ResourceNotFoundException
RedshiftDataAPIService.Client.exceptions.InternalServerException