---
title: "SQL-003: Generate TOWID from tower.TOWER_SEQ"
summary: Retrieves the next value from the tower.TOWER_SEQ Oracle sequence to generate a TOWID for a new IMGSYS row.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Business.Imaging
reference_type: package
---

# SQL-003: Generate TOWID from tower.TOWER_SEQ

This statement retrieves the next value from the `tower.TOWER_SEQ` Oracle sequence via the `DUAL` pseudo-table. It generates the TOWID primary key used when inserting a new IMGSYS imaging system record.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-003 |
| **Operation type** | Sequence |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | SYS (DUAL) |
| **Command type** | Text** |
| **Business object** | `clsImgsys` |
| **Criteria property** | `CreateSQL` |
| **Lifecycle method** | `BeforeCreate` |

## Parameters

No parameters.

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [DUAL](../database-tables.md#dual) | SELECT (NEXTVAL) | tower.TOWER_SEQ.NEXTVAL |

## Sample SQL

```sql
SELECT tower.TOWER_SEQ.NEXTVAL FROM DUAL
```

## Operations and processes
- [Imaging system management](../operations/imaging-system-management.md)

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

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