---
title: "SQL-006: Insert IMAGE_FILE_EXT_VIEW_UPDATE row"
summary: Inserts a new row into IMAGE_FILE_EXT_VIEW_UPDATE to begin tracking external view update state for an image file.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Business.Imaging
reference_type: package
---

# SQL-006: Insert IMAGE_FILE_EXT_VIEW_UPDATE row

This statement inserts a new row into `IMAGE_FILE_EXT_VIEW_UPDATE`, recording the initial external view date, update sequence number, and audit columns for a given image file key and file code combination. `AfterInsert` verifies exactly one row was affected.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-006 |
| **Operation type** | Create |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | Text** |
| **Business object** | `clsImageFileExternalViewUpdate` |
| **Criteria property** | `InsertSQL` |
| **Lifecycle method** | `BeforeInsert` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:ImageFileCode` | Input | [not specified]** | 5 | The image file code. |
| `:ImageFileKey` | Input | [not specified]** | 5 | The image file key. |
| `:ExternalViewDate` | Input | [not specified]** | N/A | The external view date. |
| `:UpdateNum` | Input | [not specified]** | N/A | Initial update sequence number. |
| `:UpdateUser` | Input | [not specified]** | 30 | User ID of the last updater (set from CreateUser on insert). |
| `:UpdateDate` | Input | [not specified]** | N/A | Update date (set from CreateDate on insert). |
| `:CreateUser` | Input | [not specified]** | 30 | User ID of the record creator. |
| `:CreateDate` | Input | [not specified]** | N/A | Record creation date. |

## Tables

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

## Sample SQL

```sql
Insert into IMAGE_FILE_EXT_VIEW_UPDATE (
    IMAGE_FILE_CODE,
    IMAGE_FILE_KEY,
    EXTERNAL_VIEW_DATE,
    UPDATE_NUM,
    UPDATE_USER,
    UPDATE_DATE,
    CREATE_USER,
    CREATE_DATE
) Values (
    :ImageFileCode,
    :ImageFileKey,
    :ExternalViewDate,
    :UpdateNum,
    :UpdateUser,
    :UpdateDate,
    :CreateUser,
    :CreateDate
)
```

## 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`
