---
title: "SQL-007: clsXPrintControl.InsertSQL"
summary: Inserts a single print-control batch header into XPRINT_CONTROL.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Services.Printing.Remote
reference_type: package
---

# SQL-007: clsXPrintControl.InsertSQL

Inserts a new print-control batch header row into `XPRINT_CONTROL`. The caller must supply `XPrintControlSeqNum` — no live sequence generation exists for this table in this library. `IDMPathName` defaults to `"PROMPT"` per [BR-006](../business-rules.md#br-006-idm-path-default). Executed by `clsXPrintControl.BeforeInsert`.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:DirectoryName` | Input | String | 120 | Output directory for the print batch |
| `:DuplexCode` | Input | String | 5 | Duplex printing code |
| `:ProcessedDate` | Input | Date (SmartDate) | — | Date the batch was processed |
| `:XPrintControlSeqNum` | Input | Decimal | — | Primary key (caller-supplied; no live sequence generation in this library) |
| `:IDMPathName` | Input | String | 30 | Imaging (IDM) destination path (defaults to `"PROMPT"`) |
| `:XMLFileName` | Input | String | 120 | Generated XML file name for the batch |
| `:MD5HashValue` | Input | String (SmartString) | 40 | MD5 hash of the generated XML file |

## Tables

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

## Sample SQL

```sql
INSERT INTO XPRINT_CONTROL (
    DIRECTORY_NAME,
    DUPLEX_CODE,
    PROCESSED_DATE,
    XPRINT_CONTROL_SEQ_NUM,
    IDM_PATH_NAME,
    XML_FILE_NAME,
    MD5_HASH_VALUE
) VALUES (
    :DirectoryName,
    :DuplexCode,
    :ProcessedDate,
    :XPrintControlSeqNum,
    :IDMPathName,
    :XMLFileName,
    :MD5HashValue
)
```

## Operations and processes
- [Print-control batch header lifecycle](../operations/print-control-batch-header-lifecycle.md)
- [Create a print batch with documents](../operations/create-print-batch-with-documents.md)

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

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

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