statements
Creates, updates, deletes, gets or lists a statements resource.
Overview​
| Name | statements |
| Type | Resource |
| Id | aws.rds_data.statements |
Fields​
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_execute_statement | exec | region, resourceArn, secretArn, sql | Runs a batch SQL statement over an array of data. You can run bulk update and insert operations for multiple records using a DML statement with different parameter sets. Bulk operations can provide a significant performance improvement over individual insert and update operations. If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically. There isn't a fixed upper limit on the number of parameter sets. However, the maximum size of the HTTP request submitted through the Data API is 4 MiB. If the request exceeds this limit, the Data API returns an error and doesn't process the request. This 4-MiB limit includes the size of the HTTP headers and the JSON notation in the request. Thus, the number of parameter sets that you can include depends on a combination of factors, such as the size of the SQL statement and the size of each parameter set. The response size limit is 1 MiB. If the call returns more than 1 MiB of response data, the call is terminated. | |
execute_statement | exec | region, resourceArn, secretArn, sql | Runs a SQL statement against a database. If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically. If the binary response data from the database is more than 1 MB, the call is terminated. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
Lifecycle Methods​
- batch_execute_statement
- execute_statement
Runs a batch SQL statement over an array of data. You can run bulk update and insert operations for multiple records using a DML statement with different parameter sets. Bulk operations can provide a significant performance improvement over individual insert and update operations. If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically. There isn't a fixed upper limit on the number of parameter sets. However, the maximum size of the HTTP request submitted through the Data API is 4 MiB. If the request exceeds this limit, the Data API returns an error and doesn't process the request. This 4-MiB limit includes the size of the HTTP headers and the JSON notation in the request. Thus, the number of parameter sets that you can include depends on a combination of factors, such as the size of the SQL statement and the size of each parameter set. The response size limit is 1 MiB. If the call returns more than 1 MiB of response data, the call is terminated.
EXEC aws.rds_data.statements.batch_execute_statement
@region='{{ region }}' --required
@@json=
'{
"resourceArn": "{{ resourceArn }}",
"secretArn": "{{ secretArn }}",
"sql": "{{ sql }}",
"database": "{{ database }}",
"schema": "{{ schema }}",
"parameterSets": "{{ parameterSets }}",
"transactionId": "{{ transactionId }}"
}'
;
Runs a SQL statement against a database. If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically. If the binary response data from the database is more than 1 MB, the call is terminated.
EXEC aws.rds_data.statements.execute_statement
@region='{{ region }}' --required
@@json=
'{
"resourceArn": "{{ resourceArn }}",
"secretArn": "{{ secretArn }}",
"sql": "{{ sql }}",
"database": "{{ database }}",
"schema": "{{ schema }}",
"parameters": "{{ parameters }}",
"transactionId": "{{ transactionId }}",
"includeResultMetadata": {{ includeResultMetadata }},
"continueAfterTimeout": {{ continueAfterTimeout }},
"resultSetOptions": "{{ resultSetOptions }}",
"formatRecordsAs": "{{ formatRecordsAs }}"
}'
;