---
title: "SQL-017: clsXPrintControl.UpdateSQL"
summary: Updates all mutable fields of an existing print-control batch header by primary key.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Services.Printing.Remote
reference_type: package
---

# SQL-017: clsXPrintControl.UpdateSQL

Updates an existing `XPRINT_CONTROL` row, replacing directory name, duplex code, processed date, IDM path name, XML file name, and MD5 hash. `XPrintControlSeqNum` appears in both the SET list and the WHERE clause; `BeforeUpdate` calls `AddParm("XPrintControlSeqNum", ...)` twice to match both bind occurrences. Contention is detected by `AfterUpdate` per [BR-001](../business-rules.md#br-001-row-count-contention-check).

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-017 |
| **Operation type** | Update |
| **Execution method** | Inline |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | Text |
| **Business object** | `clsXPrintControl` |
| **Criteria property** | `UpdateSQL` |
| **Lifecycle method** | `BeforeUpdate` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:DirectoryName` | Input | String | 120 | Updated output directory |
| `:DuplexCode` | Input | String | 5 | Updated duplex code |
| `:XPrintControlSeqNum` (SET clause) | Input | Decimal | — | Bound for the SET list |
| `:ProcessedDate` | Input | Date (SmartDate) | — | Updated processed date |
| `:IDMPathName` | Input | String | 30 | Updated IDM path name |
| `:XMLFileName` | Input | String | 120 | Updated XML file name |
| `:MD5HashValue` | Input | String (SmartString) | 40 | Updated MD5 hash |
| `:XPrintControlSeqNum` (WHERE clause) | Input | Decimal | — | Bound a second time for the WHERE predicate |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [XPRINT_CONTROL](../database-tables.md#xprint_control) | UPDATE | `DIRECTORY_NAME`, `DUPLEX_CODE`, `PROCESSED_DATE`, `XPRINT_CONTROL_SEQ_NUM`, `IDM_PATH_NAME`, `XML_FILE_NAME`, `MD5_HASH_VALUE` |

## Sample SQL

```sql
Update XPRINT_CONTROL Set
    DIRECTORY_NAME          = :DirectoryName,
    DUPLEX_CODE             = :DuplexCode,
    PROCESSED_DATE          = :ProcessedDate,
    XPRINT_CONTROL_SEQ_NUM  = :XPrintControlSeqNum,
    IDM_PATH_NAME           = :IDMPathName,
    XML_FILE_NAME           = :XMLFileName,
    MD5_HASH_VALUE          = :MD5HashValue
Where
    XPRINT_CONTROL.XPRINT_CONTROL_SEQ_NUM = :XPrintControlSeqNum
```

## Business rules
- [BR-001: Row-count contention check](../business-rules.md#br-001-row-count-contention-check)

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `Services\SAIF.Services.Printing.Remote\clsXPrintControl.vb`
