---
title: "SQL-027: Retrieve period rating context from WCIS and legacy tables"
summary: Retrieve period rating context from WCIS and legacy tables
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Rating
reference_type: package
---

# SQL-027: Retrieve period rating context from WCIS and legacy tables

This document records the SQL used by `clsPeriodRatingInfo` in `SAIF.Business.Policy.Rating`.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-027 |
| **Operation type** | Read |
| **Execution method** | Application method — text (direct class SQL) |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | Text |
| **Business object** | `clsPeriodRatingInfo` |
| **Criteria property** | `N/A — non-Criteria class SQL` |
| **Lifecycle method** | `GetPeriodRatingInfo / GetCurrentPeriodRatingInfo` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:PolicyNumber` | Input | Not specified | not specified | Bound parameter. |
| `:PolicyPeriodEffectiveDate` | Input | Not specified | not specified | Bound parameter. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [POLICY](../database-tables.md#policy) | SELECT | See sample SQL and source for column usage. |
| [POLICY_PERIOD](../database-tables.md#policy_period) | SELECT | See sample SQL and source for column usage. |
| [POLICY_PERIOD_NON_WCIS](../database-tables.md#policy_period_non_wcis) | SELECT | See sample SQL and source for column usage. |

## Sample SQL

```sql
SELECT
  pp.anniversary_rate_date as AnniversaryRatingDate,
  p.market_type_code as MarketTypeCode,
  pp.ard_extension_flag as ARDExtensionFlag,
  pp.policy_period_eff_date as EffectiveDate,
  pp.policy_period_exp_date as ExpirationDate,
  pp.risk_type_code as RateTierCode
FROM
  policy p,
  policy_period pp
WHERE
  p.policy_num = :PolicyNumber
  AND p.policy_num = pp.policy_num
  AND pp.policy_period_eff_date = :PolicyPeriodEffectiveDate
UNION
SELECT
  pp.anniversary_rate_date as AnniversaryRatingDate,
  p.market_type_code as MarketTypeCode,
  pp.ard_extension_flag as ARDExtensionFlag,
  pp.policy_period_eff_date as EffectiveDate,
  pp.policy_period_exp_date as ExpirationDate,
  pp.risk_type_code as RateTierCode
FROM
  policy p,
  policy_period_non_wcis pp
WHERE
  p.policy_num = :PolicyNumber
  AND p.policy_num = pp.policy_num
  AND pp.policy_period_eff_date = :PolicyPeriodEffectiveDate
```

## Operations and processes
- [Retrieve period rating information](../operations/retrieve-period-rating-information.md)

## Business rules
- [BR-015](../business-rules.md#br-015-period-rating-information-must-be-sought-in-both-the-current-policy_period-table-and-the-legacy-policy_period_non_wcis-table-combined-with-union)
- [BR-016](../business-rules.md#br-016-current-period-rating-information-is-the-row-whose-policy-period-effective-date-equals-the-maximum-effective-date-for-that-policy-ordered-descending)
- [BR-017](../business-rules.md#br-017-period-rating-info-retrieval-always-returns-an-object-an-empty-default-instance-is-returned-when-no-row-matches)

> **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.Rating\clsPeriodRatingInfo.vb:145-243`