---
title: "SQL-005: Insert a new application code"
summary: Insert a new application code
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Business.Menu
reference_type: package
---

# SQL-005: Insert a new application code

This statement is the `InsertSQL` implementation of `clsApplicationCode.Criteria`, executed from `BeforeInsert` against `BUSONLINE_APPS_CODE`. Insert a new application code.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:Code` | Input | String | 5 | Application code natural key supplied by the caller |
| `:CodeDescr` | Input | String | N/A | Present in the SQL text; **not bound** by `BeforeInsert` — no matching `AddParm` call exists* |
| `:ApplicationPath` | Input | String | 65 | Virtual-directory path bound as the fourth value, even though only three columns are listed* |
| `:ActiveFlag` | Input | String | 1 | Active flag as `Y`/`N` (`IsActive.ToY_N_String`) |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [BUSONLINE_APPS_CODE](../database-tables.md#busonline_apps_code) | INSERT | CODE, CODE_DESCR, ACTIVE_CODE |

## Sample SQL

```sql
-- Insert a new application code
Insert into
  BUSONLINE_APPS_CODE
  (
  CODE,
  CODE_DESCR,
  ACTIVE_CODE
  )
Values
  (
  :Code,
  :CodeDescr,
  :ApplicationPath,
  :ActiveFlag
  )
```

## Operations and processes

- [Create a menu item](../operations/op-menu-06-create-menu-item.md)

## Business rules

- [BR-MENU-015](../business-rules.md#br-menu-015-natural-key-creation-for-codes): Natural-key creation for codes
- [BR-MENU-020](../business-rules.md#br-menu-020-single-row-write-verification): Single-row write verification

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- SAIF.Business.Menu/clsApplicationCode.vb
