---
title: "SQL-015: clsXDeferredPrint.UpdateSQL"
summary: Updates all mutable fields of an existing deferred print item by primary key.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Services.Printing.Remote
reference_type: package
---

# SQL-015: clsXDeferredPrint.UpdateSQL

Updates an existing `XDEFERRED_PRINT` row, replacing all mutable fields: copies count, document description, duplex code, file name, printed date, the ten sort values, the XML payload blob, and the sequence number (in both SET and WHERE clauses). Executed by `clsXDeferredPrint.BeforeUpdate`. Post-update contention is detected by `AfterUpdate` per [BR-001](../business-rules.md#br-001-row-count-contention-check).

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:CopiesCount` | Input | Decimal | — | Updated copies count |
| `:DocumentDescr` | Input | String | 60 | Updated document description |
| `:DuplexCode` | Input | String | 5 | Updated duplex code |
| `:FileName` | Input | String | 120 | Updated file name |
| `:PrintedDate` | Input | Date (SmartDate) | — | Updated printed date |
| `:Sort0Value` | Input | String (SmartString) | 120 | Updated sort column 0 |
| `:Sort1Value` | Input | String (SmartString) | 120 | Updated sort column 1 |
| `:Sort2Value` | Input | String (SmartString) | 120 | Updated sort column 2 |
| `:Sort3Value` | Input | String (SmartString) | 120 | Updated sort column 3 |
| `:Sort4Value` | Input | String (SmartString) | 120 | Updated sort column 4 |
| `:Sort5Value` | Input | String (SmartString) | 120 | Updated sort column 5 |
| `:Sort6Value` | Input | String (SmartString) | 120 | Updated sort column 6 |
| `:Sort7Value` | Input | String (SmartString) | 120 | Updated sort column 7 |
| `:Sort8Value` | Input | String (SmartString) | 120 | Updated sort column 8 |
| `:Sort9Value` | Input | String (SmartString) | 120 | Updated sort column 9 |
| `:XMLValueText` | Input | NCLOB (`AddNCLobParm`) | — | Updated XML payload |
| `:XdeferredSeqNum` | Input | Decimal | — | Primary key (bound for both SET list and WHERE clause) |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [XDEFERRED_PRINT](../database-tables.md#xdeferred_print) | UPDATE | `COPIES_COUNT`, `DOCUMENT_DESCR`, `DUPLEX_CODE`, `FILE_NAME`, `PRINTED_DATE`, `SORT0_VALUE`–`SORT9_VALUE`, `XML_VALUE_TEXT`, `XDEFERRED_SEQ_NUM` |

## Sample SQL

```sql
Update XDEFERRED_PRINT Set
    COPIES_COUNT    = :CopiesCount,
    DOCUMENT_DESCR  = :DocumentDescr,
    DUPLEX_CODE     = :DuplexCode,
    FILE_NAME       = :FileName,
    PRINTED_DATE    = :PrintedDate,
    SORT0_VALUE     = :Sort0Value,
    SORT1_VALUE     = :Sort1Value,
    SORT2_VALUE     = :Sort2Value,
    SORT3_VALUE     = :Sort3Value,
    SORT4_VALUE     = :Sort4Value,
    SORT5_VALUE     = :Sort5Value,
    SORT6_VALUE     = :Sort6Value,
    SORT7_VALUE     = :Sort7Value,
    SORT8_VALUE     = :Sort8Value,
    SORT9_VALUE     = :Sort9Value,
    XML_VALUE_TEXT  = :XMLValueText,
    XDEFERRED_SEQ_NUM = :XdeferredSeqNum
Where
    XDEFERRED_PRINT.XDEFERRED_SEQ_NUM = :XdeferredSeqNum
```

## 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\clsXDeferredPrint.vb`
