BatchExecuteStatement
This operation allows you to perform batch reads or writes on data stored in DynamoDB,
using PartiQL. Each read statement in a BatchExecuteStatement
must specify
an equality condition on all key attributes. This enforces that each SELECT
statement in a batch returns at most a single item. For more information, see Running batch operations with PartiQL for DynamoDB
.
Note
The entire batch must consist of either read statements or write statements, you cannot mix both in one batch.
Important
A HTTP 200 response does not mean that all statements in the BatchExecuteStatement
succeeded. Error details for individual statements can be found under the Error field of the BatchStatementResponse
for each
statement.
Request Syntax
{
"ReturnConsumedCapacity": "string
",
"Statements": [
{
"ConsistentRead": boolean
,
"Parameters": [
{
"B": blob
,
"BOOL": boolean
,
"BS": [ blob
],
"L": [
"AttributeValue"
],
"M": {
"string
" : "AttributeValue"
},
"N": "string
",
"NS": [ "string
" ],
"NULL": boolean
,
"S": "string
",
"SS": [ "string
" ]
}
],
"ReturnValuesOnConditionCheckFailure": "string
",
"Statement": "string
"
}
]
}
Request Parameters
The request accepts the following data in JSON format.
Note
In the following list, the required parameters are described first.
- Statements
-
The list of PartiQL statements representing the batch to run.
Type: Array of BatchStatementRequest objects
Array Members: Minimum number of 1 item. Maximum number of 25 items.
Required: Yes
- ReturnConsumedCapacity
-
Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
Type: String
Valid Values:
INDEXES | TOTAL | NONE
Required: No
-
Response Syntax
{
"ConsumedCapacity": [
{
"CapacityUnits": number,
"GlobalSecondaryIndexes": {
"string" : {
"CapacityUnits": number,
"ReadCapacityUnits": number,
"WriteCapacityUnits": number
}
},
"LocalSecondaryIndexes": {
"string" : {
"CapacityUnits": number,
"ReadCapacityUnits": number,
"WriteCapacityUnits": number
}
},
"ReadCapacityUnits": number,
"Table": {
"CapacityUnits": number,
"ReadCapacityUnits": number,
"WriteCapacityUnits": number
},
"TableName": "string",
"WriteCapacityUnits": number
}
],
"Responses": [
{
"Error": {
"Code": "string",
"Item": {
"string" : {
"B": blob,
"BOOL": boolean,
"BS": [ blob ],
"L": [
"AttributeValue"
],
"M": {
"string" : "AttributeValue"
},
"N": "string",
"NS": [ "string" ],
"NULL": boolean,
"S": "string",
"SS": [ "string" ]
}
},
"Message": "string"
},
"Item": {
"string" : {
"B": blob,
"BOOL": boolean,
"BS": [ blob ],
"L": [
"AttributeValue"
],
"M": {
"string" : "AttributeValue"
},
"N": "string",
"NS": [ "string" ],
"NULL": boolean,
"S": "string",
"SS": [ "string" ]
}
},
"TableName": "string"
}
]
}
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.
- ConsumedCapacity
-
The capacity units consumed by the entire operation. The values of the list are ordered according to the ordering of the statements.
Type: Array of ConsumedCapacity objects
- Responses
-
The response to each PartiQL statement in the batch. The values of the list are ordered according to the ordering of the request statements.
Type: Array of BatchStatementResponse objects
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServerError
-
An error occurred on the server side.
HTTP Status Code: 500
- RequestLimitExceeded
-
Throughput exceeds the current throughput quota for your account. Please contact AWS Support
to request a quota increase. HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: