Class: Google::Spanner::V1::ExecuteBatchDmlResponse
- Inherits:
-
Object
- Object
- Google::Spanner::V1::ExecuteBatchDmlResponse
- Defined in:
- lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb
Overview
The response for ExecuteBatchDml. Contains a list of ResultSet, one for each DML statement that has successfully executed. If a statement fails, the error is returned as part of the response payload. Clients can determine whether all DML statements have run successfully, or if a statement failed, using one of the following approaches:
1. Check if 'status' field is OkStatus.
2. Check if result_sets_size() equals the number of statements in
{Spanner::ExecuteBatchDmlRequest ExecuteBatchDmlRequest}.
Example 1: A request with 5 DML statements, all executed successfully. Result: A response with 5 ResultSets, one for each statement in the same order, and an OK status.
Example 2: A request with 5 DML statements. The 3rd statement has a syntax error. Result: A response with 2 ResultSets, for the first 2 statements that run successfully, and a syntax error (INVALID_ARGUMENT) status. From result_set_size() client can determine that the 3rd statement has failed.
Instance Attribute Summary collapse
-
#result_sets ⇒ Array<Google::Spanner::V1::ResultSet>
ResultSets, one 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, status will be OK.
Instance Attribute Details
#result_sets ⇒ Array<Google::Spanner::V1::ResultSet>
Returns ResultSets, one for each statement in the request that ran successfully, in the same order as the statements in the request. Each ResultSet will not contain any rows. The ResultSetStats in each ResultSet will contain the number of rows modified by the statement.
Only the first ResultSet in the response contains a valid ResultSetMetadata.
293 |
# File 'lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb', line 293 class ExecuteBatchDmlResponse; end |
#status ⇒ Google::Rpc::Status
Returns If all DML statements are executed successfully, status will be OK. Otherwise, the error status of the first failed statement.
293 |
# File 'lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb', line 293 class ExecuteBatchDmlResponse; end |