---
title: "SQL-001: Retrieve affiliate by SSN"
summary: Retrieve one affiliate person record by SSN.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Affiliate
reference_type: package
---

# SQL-001: Retrieve affiliate by SSN

Retrieve one affiliate person record by SSN.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:AffiliateID` | Input | String (`AFFILIATE_SSN`) | 11 | Affiliate SSN — the person key. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [AFFILIATE](../database-tables.md#affiliate) | SELECT | `AFFILIATE_SSN`, `AFFILIATE_FIRST_NAME`, `AFFILIATE_INITIAL`, `AFFILIATE_LAST_NAME`, `AFFILIATE_SUFFIX`, `AFFILIATE_DOB`, `CREATE_DATE`, `CREATE_USER`, `UPDATE_DATE`, `UPDATE_USER` |

## Sample SQL

```sql
SELECT
  A.AFFILIATE_SSN as AffiliateID,
  A.AFFILIATE_FIRST_NAME as FirstName,
  A.AFFILIATE_INITIAL as MiddleInitial,
  A.AFFILIATE_LAST_NAME as LastName,
  A.AFFILIATE_SUFFIX as NameSuffix,
  A.AFFILIATE_DOB as BirthDate,
  A.CREATE_DATE as CreateDate,
  A.CREATE_USER as CreateUser,
  A.UPDATE_DATE as UpdateDate,
  A.UPDATE_USER as UpdateUser
FROM AFFILIATE A
WHERE
  A.AFFILIATE_SSN = :AffiliateID
```

## Operations and processes
- [Retrieve an affiliate by SSN](../operations/retrieve-an-affiliate-by-ssn.md)

## Business rules
- [BR-AFF-001: Missing-key retrieval returns a default object](../business-rules.md#br-aff-001-missing-key-retrieval-returns-a-default-object)
- [BR-AFF-002: Affiliate display names omit empty parts](../business-rules.md#br-aff-002-affiliate-display-names-omit-empty-parts)
- [BR-AFF-018: The library exposes retrieve-only data access](../business-rules.md#br-aff-018-the-library-exposes-retrieve-only-data-access)
- [BR-AFF-020: Stale cached affiliate objects are reloaded on access](../business-rules.md#br-aff-020-stale-cached-affiliate-objects-are-reloaded-on-access)

> **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.Policy.Affiliate\clsAffiliate.vb`
