# Google Cloud Spanner v1 API - Class ExecuteBatchDmlResponse (5.13.0-beta07)

5.13.0-beta07 5.13.0-beta06 5.12.0 (latest) 5.11.0 5.10.0 5.9.0 5.8.0 5.7.0 5.6.0 5.5.0 5.4.0 5.3.0 5.2.0 5.1.0 5.0.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.15.1 3.14.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0

    public sealed class ExecuteBatchDmlResponse : IMessage<ExecuteBatchDmlResponse>, IEquatable<ExecuteBatchDmlResponse>, IDeepCloneable<ExecuteBatchDmlResponse>, IBufferMessage, IMessage

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

The response for
\[ExecuteBatchDml\]\[google.spanner.v1.Spanner.ExecuteBatchDml\]. Contains a list
of \[ResultSet\]\[google.spanner.v1.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\]\[google.spanner.v1.ResultSet\] messages, then statement `N+1` in the request failed.

Example 1:

- Request: 5 DML statements, all executed successfully.
- Response: 5 \[ResultSet\]\[google.spanner.v1.ResultSet\] messages, with the status `OK`.

Example 2:

- Request: 5 DML statements. The third statement has a syntax error.
- Response: 2 \[ResultSet\]\[google.spanner.v1.ResultSet\] messages, and a syntax error (`INVALID_ARGUMENT`) status. The number of \[ResultSet\]\[google.spanner.v1.ResultSet\] messages indicates that the third statement failed, and the fourth and fifth statements were not executed.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> ExecuteBatchDmlResponse

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ExecuteBatchDmlResponse](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ExecuteBatchDmlResponse](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ExecuteBatchDmlResponse](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Spanner.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1)

## Assembly

Google.Cloud.Spanner.V1.dll

## Constructors

### ExecuteBatchDmlResponse()

    public ExecuteBatchDmlResponse()

### ExecuteBatchDmlResponse(ExecuteBatchDmlResponse)

    public ExecuteBatchDmlResponse(ExecuteBatchDmlResponse other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse` |

## Properties

### PrecommitToken

    public MultiplexedSessionPrecommitToken PrecommitToken { get; set; }

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\]\[google.spanner.v1.Spanner.Commit\] request for this transaction.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.MultiplexedSessionPrecommitToken` |   |

### ResultSets

    public RepeatedField<ResultSet> ResultSets { get; }

One \[ResultSet\]\[google.spanner.v1.ResultSet\] for each statement in the
request that ran successfully, in the same order as the statements in the
request. Each \[ResultSet\]\[google.spanner.v1.ResultSet\] does not contain any
rows. The \[ResultSetStats\]\[google.spanner.v1.ResultSetStats\] in each
\[ResultSet\]\[google.spanner.v1.ResultSet\] contain the number of rows
modified by the statement.

Only the first \[ResultSet\]\[google.spanner.v1.ResultSet\] in the response
contains valid \[ResultSetMetadata\]\[google.spanner.v1.ResultSetMetadata\].

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ResultSet` |   |

### Status

    public Status Status { get; set; }

If all DML statements are executed successfully, the status is `OK`.
Otherwise, the error status of the first failed statement.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Status.html` |   |