---
title: "SQL-001: Max PA auditor ID + 1"
summary: Sequence surrogate — retrieves the next available auditor ID from PA_AUDITOR.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Business.External.Users
reference_type: package
---

# SQL-001: Max PA auditor ID + 1

Retrieves `MAX(PA_AUDITOR_ID) + 1` from `PA_AUDITOR` to generate the next available auditor identifier before inserting a new auditor record. This library uses a MAX+1 pattern rather than an Oracle sequence for this table.

## Classification

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

## Parameters

This statement has no bind parameters.

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [PA_AUDITOR](../database-tables.md#pa_auditor) | SELECT | `PA_AUDITOR_ID` |

## Sample SQL

```sql
SELECT TO_NUMBER(MAX(PA_AUDITOR_ID)) + 1 FROM PA_AUDITOR
```

## Operations and processes
- [Auditor assignment / override](../operations/auditor-assignment-override.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.External.Users\clsAuditor.vb`
