---
title: "SQL-011: Retrieve auditor by ID or user"
summary: Retrieves a single auditor record from PA_AUDITOR by auditor ID or AD user ID.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Business.External.Users
reference_type: package
---

# SQL-011: Retrieve auditor by ID or user

Retrieves a single auditor record from `PA_AUDITOR` matching either the numeric auditor ID or the AD user ID.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-011 |
| **Operation type** | Read |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | Text |
| **Business object** | `clsAuditor` |
| **Criteria property** | `RetrieveSQL` |
| **Lifecycle method** | `BeforeRetrieve` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:AuditorID` | Input | Decimal | N/A | Auditor primary key. |
| `:UserID` | Input | String | 30 | AD user ID of the auditor. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [PA_AUDITOR](../database-tables.md#pa_auditor) | SELECT | `PA_AUDITOR_ID`, `ASSIGN_FLAG`, `AUDITOR_ASSIGNEE_ID`, `AUDITOR_EMAIL_ADDR`, `AUDITOR_NAME`, `AUDITOR_SHORT_NAME`, `FILTER_LIST_FLAG`, `MONTHLY_MAXIMUM_COUNT`, `SCHEDULE_FLAG`, `USER_ID`, `VENDOR_NUM`, `REVIEWER_FLAG`, `ACTIVE_REVIEWER_FLAG` |

## Sample SQL

```sql
SELECT
    pa_auditor.assign_flag AS assignflag,
    pa_auditor.auditor_assignee_id AS auditorassigneeid,
    pa_auditor.auditor_email_addr AS auditoremailaddr,
    pa_auditor.auditor_name AS auditorname,
    pa_auditor.auditor_short_name AS auditorshortname,
    pa_auditor.filter_list_flag AS filterlistflag,
    pa_auditor.monthly_maximum_count AS monthlymaximumcount,
    pa_auditor.pa_auditor_id AS auditorid,
    pa_auditor.schedule_flag AS scheduleflag,
    pa_auditor.user_id AS userid,
    pa_auditor.vendor_num AS vendornumber,
    pa_auditor.reviewer_flag AS ReviewerFlag,
    pa_auditor.active_reviewer_flag AS ActiveReviewerFlag
FROM pa_auditor
WHERE pa_auditor.pa_auditor_id = :AuditorID
   OR upper(pa_auditor.user_id) = upper(:UserID)
```

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