This section describes how to use batch statements with PartiQL for DynamoDB.
Note
-
The entire batch must consist of either read statements or write statements; you cannot mix both in one batch.
-
BatchExecuteStatement
andBatchWriteItem
can perform no more than 25 statements per batch.
Topics
Syntax
[
{
"Statement":" statement
",
"Parameters":[
{
" parametertype
" : " parametervalue
"
}, ...]
} , ...
]
Parameters
statement
-
(Required) A PartiQL for DynamoDB supported statement.
Note
-
The entire batch must consist of either read statements or write statements; you cannot mix both in one batch.
-
BatchExecuteStatement
andBatchWriteItem
can perform no more than 25 statements per batch.
-
parametertype
-
(Optional) A DynamoDB type, if parameters were used when specifying the PartiQL statement.
parametervalue
-
(Optional) A parameter value if parameters were used when specifying the PartiQL statement.
Examples
-
Save the following json to a file called partiql.json
[ { "Statement": "INSERT INTO Music VALUE {'Artist':?,'SongTitle':?}", "Parameters": [{"S": "Acme Band"}, {"S": "Best Song"}] }, { "Statement": "UPDATE Music SET AwardsWon=1, AwardDetail={'Grammys':[2020, 2018]} WHERE Artist='Acme Band' AND SongTitle='PartiQL Rocks'" } ]
-
Run the following command in a command prompt.
aws dynamodb batch-execute-statement --statements file://partiql.json