---
title: "SQL-002: Generate MENU_ITEM_SEQ next value"
summary: Oracle sequence NEXTVAL query for MENU_ITEM primary key generation.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business.Menu
reference_type: package
---

# SQL-002: Generate MENU_ITEM_SEQ next value

Retrieves the next value from the `MENU_ITEM_SEQ` Oracle sequence to generate the primary key for a new `clsMenuItem` record before insert.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-002 |
| **Operation type** | Sequence |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | Text |
| **Business object** | `clsMenuItem` |
| **Criteria property** | `CreateSQL` |
| **Lifecycle method** | `BeforeCreate` / `AfterCreate` |

## Parameters

No parameters.

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [DUAL](../database-tables.md#dual) | SELECT | N/A (NEXTVAL expression only) |

## Sample SQL

```sql
SELECT MENU_ITEM_SEQ.NEXTVAL FROM DUAL
```

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


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