---
title: "SQL-008: Insert menu item"
summary: Inserts a new menu item (tree node) into MENU_ITEM.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business.Menu
reference_type: package
---

# SQL-008: Insert menu item

Inserts a new menu item record into the `MENU_ITEM` table. The primary key (`MenuItemSeqNum`) is obtained beforehand via [SQL-002](SQL-002-saif-business-menu.md). `UPDATE_DATE` is set to `SYSDATE`.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:MenuItemSeqNum` | Input | Decimal** | N/A | Primary key bound from `MenuItemSeqNum`. |
| `:MenuPageSeqNum` | Input | Decimal** | N/A | Parent page FK bound from `MenuPageSeqNum`. |
| `:MenuCategoryCode` | Input | String** | 5 | Category code bound from `MenuCategoryCode`. |
| `:ToolTip` | Input | String** | 1000 | Tooltip text bound from `m_ToolTip`. |
| `:VisibleFlag` | Input | String** | 1 | Visibility flag bound from `IsVisible.ToY_N_String`. |
| `:PageOrder` | Input | Decimal** | N/A | Display order bound from `PageOrder`. |
| `:UserId` | Input | String** | 30 | Update user bound from `DataPortalInfo.UserID`. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [MENU_ITEM](../database-tables.md#menu-item) | INSERT | `MENU_ITEM_SEQ_NUM`, `MENU_PAGE_SEQ_NUM`, `MENU_CATEGORY_CODE`, `TOOL_TIP_TXT`, `VISIBLE_FLAG`, `PAGE_ORDER_NUM`, `UPDATE_DATE`, `UPDATE_USER` |

## Sample SQL

```sql
Insert into MENU_ITEM (
    MENU_ITEM_SEQ_NUM, MENU_PAGE_SEQ_NUM, MENU_CATEGORY_CODE,
    TOOL_TIP_TXT, VISIBLE_FLAG, PAGE_ORDER_NUM, UPDATE_DATE, UPDATE_USER
) Values (
    :MenuItemSeqNum, :MenuPageSeqNum, :MenuCategoryCode,
    :ToolTip, :VisibleFlag, :PageOrder, SYSDATE, :UserId
)
```

## Operations and processes
- [Menu tree construction](../operations/menu-tree-construction.md)


## Business rules
- [BR-MNU-02: DML row-count enforcement](../business-rules.md#br-mnu-02-dml-row-count-enforcement)


> **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
- `Business\SAIF.Business.Menu\clsMenuItem.vb`
