---
title: "SQL-005: Policy address retrieval by address type"
summary: Retrieve a policy address by address and contact type.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-31
library: SAIF.Business.View.Policy
reference_type: package
---

# SQL-005: Policy address retrieval by address type

`clsPolicyAddress` uses this call to load one address for a policy, selected by address type and contact type. The procedure can substitute the mailing address when a claim address is requested and none is active.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-005 |
| **Operation type** | Read |
| **Execution method** | Stored procedure |
| **Database** | Oracle |
| **Schema** | `[unqualified]`** |
| **Command type** | StoredProcedure |
| **Business object** | `clsPolicyAddress` |
| **Criteria property** | `RetrieveSQL` |
| **Lifecycle method** | `BeforeRetrieve` / `AfterRetrieve` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:inPolicyNum` | Input | Decimal | not specified | Policy number owning the address. |
| `:inAddressType` | Input | String | 5 | Address/location type code (mailing, claim, third-party manager, policyholder). |
| `:inContactType` | Input | String | 5 | Contact type code used to select the associated contact row. |
| `:inGetMailAddrWhenNotFound` | Input | String | 5 | Y/N flag requesting mailing-address fallback when no active claim address exists. |
| `recordset` | Output (Cursor) | REF CURSOR | N/A | Result set carrying the selected address and contact row. |

## Tables

No table is referenced directly in the .NET source. The tables read by the procedure body reside in the Oracle database and are described under [pk72846_view_policy](../procedures/pk72846_view_policy.md).

## Sample SQL

```sql
-- Stored procedure call (procedure body resides in the Oracle database - WCIS_DBA.pk72846_view_policy)
CALL pk72846_view_policy.getPolicyAddress(
  inpolicynum               => :inPolicyNum,
  inaddresstype             => :inAddressType,
  incontacttype             => :inContactType,
  ingetmailaddrwhennotfound => :inGetMailAddrWhenNotFound,
  recordset                 => :recordset)  -- REF CURSOR output
```

## Operations and processes

- [Retrieve supporting policy aggregates](../operations/retrieve-supporting-policy-aggregates.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.View.Policy/clsPolicyAddress.vb`
