Cloud Spanner V1 API - Class Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse (v0.12.0)

Reference documentation and code samples for the Cloud Spanner V1 API class Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse.

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:

  1. Check the status in the response message. The [google.rpc.Code][google.rpc.Code] enum value OK indicates that all statements were executed successfully.
  2. If the status was not OK, check the number of result sets in the response. If the response contains N ResultSet messages, then statement N+1 in the request failed.

Example 1:

  • Request: 5 DML statements, all executed successfully.
  • Response: 5 ResultSet messages, with the status OK.

Example 2:

  • Request: 5 DML statements. The third statement has a syntax error.
  • Response: 2 ResultSet messages, and a syntax error (INVALID_ARGUMENT) status. The number of ResultSet messages indicates that the third statement failed, and the fourth and fifth statements were not executed.

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#result_sets

def result_sets() -> ::Array<::Google::Cloud::Spanner::V1::ResultSet>
Returns

#result_sets=

def result_sets=(value) -> ::Array<::Google::Cloud::Spanner::V1::ResultSet>
Parameter
Returns

#status

def status() -> ::Google::Rpc::Status
Returns
  • (::Google::Rpc::Status) — If all DML statements are executed successfully, the status is OK. Otherwise, the error status of the first failed statement.

#status=

def status=(value) -> ::Google::Rpc::Status
Parameter
  • value (::Google::Rpc::Status) — If all DML statements are executed successfully, the status is OK. Otherwise, the error status of the first failed statement.
Returns
  • (::Google::Rpc::Status) — If all DML statements are executed successfully, the status is OK. Otherwise, the error status of the first failed statement.