---
title: Read Pa Selection Rule Data
summary: SQL-065
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Audit.Premium
reference_type: package
---

# SQL-065: Read Pa Selection Rule Data

This statement supports the premium-audit library by read Pa Selection Rule Data.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-065 |
| **Operation type** | Read |
| **Execution method** | IDataRequest.SQLStatement (CommandType.Text) |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | Text |
| **Business object** | `clsAuditSelectionTesterValueCollection` |
| **Criteria property** | `RetrieveSQL` |
| **Lifecycle method** | `BeforeRetrieve / AfterRetrieve` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:PATypeCode` | Input | bound from `MyCriteria.PremiumAuditTypeCode` | 5 | Bound in `clsAuditSelectionTesterValueCollection.BeforeRetrieve` (line 86) |
| `:SelectionCategoryCode` | Input | bound from `MyCriteria.SelectionCategoryCode` | 5 | Bound in `clsAuditSelectionTesterValueCollection.BeforeRetrieve` (line 87) |
| `:MarketTypeCode` | Input | bound from `MyCriteria.MarketTypeCode` | 5 | Bound in `clsAuditSelectionTesterValueCollection.BeforeRetrieve` (line 88) |
| `:ReasonCode` | Input | bound from `MyCriteria.ReasonCode` | 5 | Bound in `clsAuditSelectionTesterValueCollection.BeforeRetrieve` (line 89) |
| `:AuditDate` | Input | bound from `MyCriteria.AuditDate` | — | Bound in `clsAuditSelectionTesterValueCollection.BeforeRetrieve` (line 90) |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [`PA_SELECTION_RULE`](../database-tables.md#pa_selection_rule) | JOIN | See sample SQL. |
| [`PA_SLCTN_CAT_MKT_TYPE_RSN_RULE`](../database-tables.md#pa_slctn_cat_mkt_type_rsn_rule) | JOIN | See sample SQL. |
| [`PA_SLCTN_CATEGORY_MARKET_TYPE`](../database-tables.md#pa_slctn_category_market_type) | JOIN | See sample SQL. |
| [`PA_SELECTION_RULE_VALUE`](../database-tables.md#pa_selection_rule_value) | JOIN | See sample SQL. |

## Sample SQL

```sql
SELECT
  PA_SELECTION_RULE_ID as RuleID,
  SELECTION_RULE_VALUE_TEXT as RuleValueText,
  SELECTION_RULE_RANGE_LOW_TEXT as RuleRangeLowText,
  SELECTION_RULE_RANGE_HIGH_TEXT as RuleRangeHighText,
  SELECTION_RULE_LIST_TEXT as RuleListText,
  PA_SLCTN_RULE_VAL_TYPE_CODE as RuleValueTypeCode
FROM
  PA_SELECTION_RULE SR
JOIN
  PA_SLCTN_CAT_MKT_TYPE_RSN_RULE SCMTRR Using (PA_SELECTION_RULE_ID)
JOIN
  PA_SLCTN_CATEGORY_MARKET_TYPE SCM USING (PA_SELECTION_CATEGORY_CODE, MARKET_TYPE_CODE, PA_TYPE_CODE)
JOIN
  PA_SELECTION_RULE_VALUE SRV Using (PA_SELECTION_RULE_ID)
WHERE
  PA_TYPE_CODE = :PATypeCode
  AND PA_SELECTION_CATEGORY_CODE = :SelectionCategoryCode
  AND MARKET_TYPE_CODE = :MarketTypeCode
  AND PA_REASON_CODE = :ReasonCode
  AND (
    (POLICY_EFF_RULE_FLAG = 'N'
     AND sysdate between Rule_eff_date and nvl(rule_exp_date - 1, sysdate + 1))
    OR
    (POLICY_EFF_RULE_FLAG = 'Y'
     AND :AuditDate between Rule_eff_date and nvl(rule_exp_date - 1, :AuditDate + 1)))
```

## Operations and processes
- [Run audit selection tests](../operations/run-audit-selection-tests.md)

## Business rules
- [BR-002](../business-rules.md#br-002-disqualifying-selection-test-blocks-selection)
- [BR-003](../business-rules.md#br-003-qualifying-tests-select-audit)



> **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.Audit.Premium/clsAuditSelectionTesterValueCollection.vb:239`
