/AWS1/IF_RSD=>DESCRIBESTATEMENT()¶
About DescribeStatement¶
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 CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
Method Signature¶
METHODS /AWS1/IF_RSD~DESCRIBESTATEMENT
IMPORTING
!IV_ID TYPE /AWS1/RSDUUID OPTIONAL
!IV_WAITTIMESECONDS TYPE /AWS1/RSDWAITTIMESECONDS OPTIONAL
PREFERRED PARAMETER iv_id
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_rsddescrstmtresponse
RAISING
/AWS1/CX_RSDACTWAITREQSEXCDEX
/AWS1/CX_RSDINTERNALSERVEREX
/AWS1/CX_RSDRESOURCENOTFOUNDEX
/AWS1/CX_RSDVALIDATIONEX
/AWS1/CX_RSDCLIENTEXC
/AWS1/CX_RSDSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_id TYPE /AWS1/RSDUUID /AWS1/RSDUUID¶
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:2has a suffix of:2that indicates the second SQL statement of a batch query. This identifier is returned byBatchExecuteStatment,ExecuteStatement, andListStatements.
Optional arguments:¶
iv_waittimeseconds TYPE /AWS1/RSDWAITTIMESECONDS /AWS1/RSDWAITTIMESECONDS¶
The number of seconds to wait for the SQL statement to complete execution before returning the description. The maximum value is 30 seconds.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_rsddescrstmtresponse /AWS1/CL_RSDDESCRSTMTRESPONSE¶
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->describestatement(
iv_id = |string|
iv_waittimeseconds = 123
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_uuid = lo_result->get_id( ).
lv_secretarn = lo_result->get_secretarn( ).
lv_string = lo_result->get_dbuser( ).
lv_string = lo_result->get_database( ).
lv_string = lo_result->get_clusteridentifier( ).
lv_long = lo_result->get_duration( ).
lv_string = lo_result->get_error( ).
lv_statusstring = lo_result->get_status( ).
lv_timestamp = lo_result->get_createdat( ).
lv_timestamp = lo_result->get_updatedat( ).
lv_long = lo_result->get_redshiftpid( ).
lv_boolean = lo_result->get_hasresultset( ).
lv_statementstring = lo_result->get_querystring( ).
lv_long = lo_result->get_resultrows( ).
lv_long = lo_result->get_resultsize( ).
lv_long = lo_result->get_redshiftqueryid( ).
LOOP AT lo_result->get_queryparameters( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_parametername = lo_row_1->get_name( ).
lv_parametervalue = lo_row_1->get_value( ).
ENDIF.
ENDLOOP.
LOOP AT lo_result->get_substatements( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_uuid = lo_row_3->get_id( ).
lv_long = lo_row_3->get_duration( ).
lv_string = lo_row_3->get_error( ).
lv_statementstatusstring = lo_row_3->get_status( ).
lv_timestamp = lo_row_3->get_createdat( ).
lv_timestamp = lo_row_3->get_updatedat( ).
lv_statementstring = lo_row_3->get_querystring( ).
lv_long = lo_row_3->get_resultrows( ).
lv_long = lo_row_3->get_resultsize( ).
lv_long = lo_row_3->get_redshiftqueryid( ).
lv_boolean = lo_row_3->get_hasresultset( ).
ENDIF.
ENDLOOP.
lv_workgroupnamestring = lo_result->get_workgroupname( ).
lv_resultformatstring = lo_result->get_resultformat( ).
lv_string = lo_result->get_sessionid( ).
lv_executionmode = lo_result->get_executionmode( ).
ENDIF.