Class: Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse
- Inherits:
-
Object
- Object
- Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse
- Extended by:
- Protobuf::MessageExts::ClassMethods
- Includes:
- Protobuf::MessageExts
- Defined in:
- proto_docs/google/spanner/v1/spanner.rb
Overview
The response for ExecuteBatchDml. Contains a list of ResultSet messages, one for each DML statement that has successfully executed, in the same order as the statements in the request. If a statement fails, the status in the response body identifies the cause of the failure.
To check for DML statements that failed, use the following approach:
- Check the status in the response message. The
[google.rpc.Code][google.rpc.Code] enum
value
OKindicates that all statements were executed successfully. - If the status was not
OK, check the number of result sets in the response. If the response containsNResultSet messages, then statementN+1in the request failed.
Example 1:
- Request: 5 DML statements, all executed successfully.
- Response: 5 ResultSet messages, with the
status
OK.
Example 2:
Instance Attribute Summary collapse
-
#precommit_token ⇒ ::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken
Optional.
-
#result_sets ⇒ ::Array<::Google::Cloud::Spanner::V1::ResultSet>
One ResultSet for each statement in the request that ran successfully, in the same order as the statements in the request.
-
#status ⇒ ::Google::Rpc::Status
If all DML statements are executed successfully, the status is
OK.
Instance Attribute Details
#precommit_token ⇒ ::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken
Returns Optional. A precommit token is included if the read-write transaction is on a multiplexed session. Pass the precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction.
680 681 682 683 |
# File 'proto_docs/google/spanner/v1/spanner.rb', line 680 class ExecuteBatchDmlResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end |
#result_sets ⇒ ::Array<::Google::Cloud::Spanner::V1::ResultSet>
Returns One ResultSet for each statement in the request that ran successfully, in the same order as the statements in the request. Each ResultSet does not contain any rows. The ResultSetStats in each ResultSet contain the number of rows modified by the statement.
Only the first ResultSet in the response contains valid ResultSetMetadata.
680 681 682 683 |
# File 'proto_docs/google/spanner/v1/spanner.rb', line 680 class ExecuteBatchDmlResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end |
#status ⇒ ::Google::Rpc::Status
Returns If all DML statements are executed successfully, the status is OK.
Otherwise, the error status of the first failed statement.
680 681 682 683 |
# File 'proto_docs/google/spanner/v1/spanner.rb', line 680 class ExecuteBatchDmlResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end |