﻿---
title: "SQL-071: Retrieve premiumset"
summary: Retrieve premiumset
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Premium
reference_type: package
---

# SQL-071: Retrieve premiumset

Retrieve premiumset in the context of `clsPremiumSet`.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-071 |
| **Operation type** | Read |
| **Execution method** | Reader/Scalar |
| **Database** | Oracle |
| **Command type** | Text |
| **Schema** | N/A — accessed via DB link @POLDB (Policy database) |
| **Business object** | `clsPremiumSet` |
| **Criteria property** | `RetrieveSQL` |
| **Lifecycle method** | BeforeRetrieve / AfterRetrieve |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:PolicyNumber` | Input | Numeric* | *inferred/unknown* | Bind variable in clsPremiumSet.RetrieveSQL. |
| `:PolicyPeriodEffectiveDate` | Input | Date | *inferred/unknown* | Bind variable in clsPremiumSet.RetrieveSQL. |
| `:PremiumSetID` | Input | Numeric* | *inferred/unknown* | Bind variable in clsPremiumSet.RetrieveSQL. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [PREM_HIST_SUMMARY](../database-tables.md#prem_hist_summary) | SELECT | See sample SQL |

## Sample SQL

```sql
SELECT
  PHS.POLICY_NUM as PolicyNumber,
  PHS.POLICY_PERIOD_EFF_DATE as PolicyPeriodEffectiveDate,
  PHS.PREM_HIST_SET_ID as PremiumSetID,
  PHS.BILL_FLAG as BillFlag,
  PHS.PREM_HIST_TYPE_CODE as PremiumSetTypeCode,
  PHS.CREATE_USER_NAME as CreateUser,
  PHS.CREATE_DATE as CreateDate,
  PHS.PST_PROCESS_DATE as PSTProcessDate,
  PHS.UPDATE_DATE as UpdateDate,
  PHS.UPDATE_USER as UpdateUser,
  PHS.COMBO_PERIOD_PREM_SET_SEQ_NUM as ComboPeriodPremSetSeqNumber,
  PHS.INTERIM_PREMIUM_ENDORSE_FLAG as InterimPremiumEndorseFlag
FROM PREM_HIST_SUMMARY PHS
WHERE
  phs.prem_hist_set_id = (select max(prem_hist_set_id) from PREM_HIST_SUMMARY phs2 where phs2.policy_num = :PolicyNumber
  AND phs2.policy_period_eff_date = :PolicyPeriodEffectiveDate
  AND phs2.prem_hist_type_code in ('1','3'))
```


> **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.Premium/clsPremiumSet.vb`
