---
title: "SQL-349: Update BatchProcessLog via UpdateRunDate"
summary: Update operation against BatchProcessLog via NHibernate ORM.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# SQL-349: Update BatchProcessLog via UpdateRunDate

This ORM statement updates the `run_date` and `control_text` columns of a `batch_process_log` row when a batch process log entry already exists, executed from `Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs (L43)`. The SQL below is inferred from the `IRepository<BatchProcessLog>.Update` call and the `BatchProcessLog` NHibernate mapping, not literal SQL text in source.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-349 |
| **Operation type** | Update |
| **Execution method** | ORM (IRepository.Update) |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | N/A (ORM-generated) |
| **Business object** | `BatchProcessLog` |
| **Criteria property** | N/A — ORM |
| **Lifecycle method** | `UpdateRunDate` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:Module` | Input | string | N/A | Identifier of the BatchProcessLog being updated (`module`) |
| `:ControlText` | Input | string | N/A | New value of `control_text` |
| `:RunDate` | Input | DateTime | N/A | New value of `run_date` |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [batch_process_log](../database-tables.md#batch_process_log) | UPDATE | `module`, `control_text`, `run_date` |

## LINQ statement

Source: `Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs:43`

```csharp
// Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs:18
_repository = _unitOfWork.GetRepository<BatchProcessLog>();

// Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs:42
record.RunDate = runDate;
_repository.Update(record);
```

## Sample SQL

> **Inferred SQL:** This SQL was inferred from the LINQ statement above and the NHibernate mappings. It is not concrete SQL from source code; NHibernate generates the executed statement at runtime, so aliases, column order, join syntax, and bind-parameter names may differ.

```sql
-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
UPDATE batch_process_log
SET
  control_text = :ControlText,
  run_date = :RunDate
WHERE module = :Module
```

Translation notes:

- No `Version(...)` mapping, so the UPDATE has no optimistic-concurrency predicate.
- `Update(entity)` emits an explicit UPDATE of every updatable mapped column (no `DynamicUpdate()` on this map).
- The `else` branch only; the `if (record == null)` branch (line 38) is an `Add` (INSERT) documented under its own SQL ID.

## Operations and processes
- BatchProcessingService.UpdateRunDate — see [Operations and processes](../operations-processes.md)

## Sources
- `Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs (L43)`
