Skip to content

aws.redshift_data.get_statement_result

Example SQL Queries

SELECT * FROM
aws.redshift_data.get_statement_result
WHERE
"id" = 'VALUE';

Description

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.

Table Definition

Column NameColumn Data Type
id Required Input Column

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.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

column_metadata

The properties (metadata) of a column.

STRUCT(
"column_default" VARCHAR,
"is_case_sensitive" BOOLEAN,
"is_currency" BOOLEAN,
"is_signed" BOOLEAN,
"label" VARCHAR,
"length" BIGINT,
"name" VARCHAR,
"nullable" BIGINT,
"precision" BIGINT,
"scale" BIGINT,
"schema_name" VARCHAR,
"table_name" VARCHAR,
"type_name" VARCHAR
)[]
Show child fields
column_metadata[]
Show child fields
column_metadata[].column_default

The default value of the column.

column_metadata[].is_case_sensitive

A value that indicates whether the column is case-sensitive.

column_metadata[].is_currency

A value that indicates whether the column contains currency values.

column_metadata[].is_signed

A value that indicates whether an integer column is signed.

column_metadata[].label

The label for the column.

column_metadata[].length

The length of the column.

column_metadata[].name

The name of the column.

column_metadata[].nullable

A value that indicates whether the column is nullable.

column_metadata[].precision

The precision value of a decimal number column.

column_metadata[].scale

The scale value of a decimal number column.

column_metadata[].schema_name

The name of the schema that contains the table that includes the column.

column_metadata[].table_name

The name of the table that includes the column.

column_metadata[].type_name

The database-specific data type of the column.

records

The results of the SQL statement.

STRUCT(
"blob_value" BLOB,
"boolean_value" BOOLEAN,
"double_value" DOUBLE,
"is_null" BOOLEAN,
"long_value" BIGINT,
"string_value" VARCHAR
)[][]
Show child fields
records[][]
Show child fields
records[][].blob_value

A value of the BLOB data type.

records[][].boolean_value

A value of the Boolean data type.

records[][].double_value

A value of the double data type.

records[][].is_null

A value that indicates whether the data is NULL.

records[][].long_value

A value of the long data type.

records[][].string_value

A value of the string data type.

total_num_rows

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.

BIGINT