---
title: "SQL-005: Insert IMAGE_DOCUMENT_NAME_CODE row"
summary: Inserts a new document name code record into the IMAGE_DOCUMENT_NAME_CODE code table.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Business.Imaging
reference_type: package
---

# SQL-005: Insert IMAGE_DOCUMENT_NAME_CODE row

This statement inserts a new row into `IMAGE_DOCUMENT_NAME_CODE`, creating a document name code entry that cross-references a file type, category, and document type. `AfterInsert` verifies exactly one row was affected.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:Code` | Input | [not specified]** | 5 | The document name code value. |
| `:CodeDescr` | Input | [not specified]** | 65 | Human-readable description of the code. |
| `:InternalDescr` | Input | [not specified]** | 256 | Internal description. |
| `:ImageFileCode` | Input | [not specified]** | 5 | The associated image file code. |
| `:ImageCategoryCode` | Input | [not specified]** | 5 | The associated image category code. |
| `:ImageDocumentTypeCode` | Input | [not specified]** | 5 | The associated image document type code. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [IMAGE_DOCUMENT_NAME_CODE](../database-tables.md#image_document_name_code) | INSERT | CODE, CODE_DESCR, INTERNAL_DESCR, IMAGE_FILE_CODE, IMAGE_CATEGORY_CODE, IMAGE_DOCUMENT_TYPE_CODE |

## Sample SQL

```sql
Insert into IMAGE_DOCUMENT_NAME_CODE (
    CODE,
    CODE_DESCR,
    INTERNAL_DESCR,
    IMAGE_FILE_CODE,
    IMAGE_CATEGORY_CODE,
    IMAGE_DOCUMENT_TYPE_CODE
) Values (
    :Code,
    :CodeDescr,
    :InternalDescr,
    :ImageFileCode,
    :ImageCategoryCode,
    :ImageDocumentTypeCode
)
```

## Operations and processes
- [Code table management](../operations/code-table-management.md)

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

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