---
title: "SQL-016: Incurred-cost aggregation"
summary: Incurred-cost aggregation.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business
reference_type: package
---

# SQL-016: Incurred-cost aggregation

This document describes `SQL-016`, the incurred-cost aggregation statement or call used by `SAIF.Business`.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-016 |
| **Operation type** | Read |
| **Execution method** | Inline |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | Text |
| **Business object** | `ClaimServices` |
| **Criteria property** | `N/A` |
| **Lifecycle method** | `IncurredCostsExist` |

## Parameters

This SQL statement has no explicit parameters in the provided findings.

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [CL_INCURRED_CATEGORY_COST](../database-tables.md#cl-incurred-cost-history-cl-incurred-category-cost) | SELECT | See sample SQL and source implementation. |
| [CL_INCURRED_COST_HISTORY](../database-tables.md#cl-incurred-cost-history-cl-incurred-category-cost) | SELECT | See sample SQL and source implementation. |

## Sample SQL

```sql
SELECT NVL(SUM(cos.incurred_cost_amt), 0) AS IncurredCostAmt
  FROM CL_INCURRED_CATEGORY_COST cos,
       CL_INCURRED_COST_HISTORY his
 WHERE his.claim_id = :ClaimID
   AND his.cl_incurred_cost_hist_seq_num = cos.cl_incurred_cost_hist_seq_num
   AND his.claim_cost_date = (
       SELECT MAX(his2.claim_cost_date)
         FROM CL_INCURRED_CATEGORY_COST cos2,
              CL_INCURRED_COST_HISTORY his2
        WHERE his2.claim_id = :ClaimID
          AND cos2.cl_incurred_cost_hist_seq_num = his2.cl_incurred_cost_hist_seq_num
   )
```

## Operations and processes
- [Claim authorization and visibility checks](../operations/claim-information-and-authorization-support.md)

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `Business\SAIF.Business\ClaimServices.vb`
