---
title: "SQL-035: clsImageFileExternalViewUpdate"
summary: Update statement for clsImageFileExternalViewUpdate.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Business.Imaging
reference_type: package
---

# SQL-035: clsImageFileExternalViewUpdate

This statement updates `IMAGE_FILE_EXT_VIEW_UPDATE` using optimistic concurrency: the WHERE clause includes `UPDATE_NUM = :UpdateNum` (the current value) and the SET clause uses `:UpdateNumPlus1` (current + 1). If a concurrent update has changed `UPDATE_NUM`, the update fails and `AfterUpdate` raises an error.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:ExternalViewDate` | Input | [not specified]** | N/A | New external view date. |
| `:UpdateNumPlus1` | Input | [not specified]** | N/A | Current UPDATE_NUM + 1 (new concurrency value). |
| `:UpdateUser` | Input | [not specified]** | 30 | User ID of the updater. |
| `:UpdateDate` | Input | [not specified]** | N/A | Update timestamp. |
| `:ImageFileKey` | Input | [not specified]** | 5 | Image file key (WHERE clause). |
| `:ImageFileCode` | Input | [not specified]** | 5 | Image file code (WHERE clause). |
| `:UpdateNum` | Input | [not specified]** | N/A | Current UPDATE_NUM for optimistic concurrency check (WHERE clause). |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [IMAGE_FILE_EXT_VIEW_UPDATE](../database-tables.md#image_file_ext_view_update) | UPDATE | EXTERNAL_VIEW_DATE, UPDATE_NUM, UPDATE_USER, UPDATE_DATE (WHERE: IMAGE_FILE_KEY, IMAGE_FILE_CODE, UPDATE_NUM) |

## Sample SQL

```sql
Update IMAGE_FILE_EXT_VIEW_UPDATE
Set
    EXTERNAL_VIEW_DATE = :ExternalViewDate,
    UPDATE_NUM = :UpdateNumPlus1,
    UPDATE_USER = :UpdateUser,
    UPDATE_DATE = :UpdateDate
where IMAGE_FILE_KEY = :ImageFileKey
  and IMAGE_FILE_CODE = :ImageFileCode
  and UPDATE_NUM = :UpdateNum
```

## Operations and processes
- [External view update tracking](../operations/external-view-update-tracking.md)

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

## Sources
- `Business\SAIF.Business.Imaging\clsImageFileExternalViewUpdate.vb`
