---
title: "SQL-358: Update RctPolicyServicePlan via ExpireServicePlan"
summary: Update operation against RctPolicyServicePlan via NHibernate ORM.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# SQL-358: Update RctPolicyServicePlan via ExpireServicePlan

This ORM statement updates a `LC_POLICY_SERVICE_PLAN` row's expiration and audit fields to expire an existing policy service plan, executed from `Services/SAIF.Services/Rct/RctServicePlanService.cs (L263)`. The SQL below is inferred from the `IRepository<RctPolicyServicePlan>.Update` call and the `RctPolicyServicePlan` NHibernate mapping, not literal SQL text in source.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-358 |
| **Operation type** | Update |
| **Execution method** | ORM (IRepository.Update) |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | N/A (ORM-generated) |
| **Business object** | `RctPolicyServicePlan` |
| **Criteria property** | N/A — ORM |
| **Lifecycle method** | `ExpireServicePlan` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:PolicyNumber` | Input | long | N/A | Identifier of the RctPolicyServicePlan being updated (`POLICY_NUM`) |
| `:EffectiveDate` | Input | DateTime | N/A | Identifier of the RctPolicyServicePlan being updated (`EFF_DATE`) |
| `:ExpirationDate` | Input | DateTime? | N/A | New value of `EXP_DATE` |
| `:ServicePlanCode` | Input | string | N/A | New value of `LC_SERVICE_PLAN_CODE` |
| `:CreateUser` | Input | string | N/A | New value of `CREATE_USER` |
| `:CreateDate` | Input | DateTime | N/A | New value of `CREATED_DATE` |
| `:UpdateUser` | Input | string | N/A | New value of `UPDATE_USER` |
| `:UpdateDate` | Input | DateTime? | N/A | New value of `UPDATE_DATE` |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [LC_POLICY_SERVICE_PLAN](../database-tables.md#lc_policy_service_plan) | UPDATE | `POLICY_NUM`, `EFF_DATE`, `EXP_DATE`, `LC_SERVICE_PLAN_CODE`, `CREATE_USER`, `CREATED_DATE`, `UPDATE_USER`, `UPDATE_DATE` |

## LINQ statement

Source: `Services/SAIF.Services/Rct/RctServicePlanService.cs:263`

```csharp
// Services/SAIF.Services/Rct/RctServicePlanService.cs:263
_unitOfWork.GetRepository<Model.Rct.RctPolicyServicePlan>().Update(servicePlanInTable);
```

## Sample SQL

> **Inferred SQL:** This SQL was inferred from the LINQ statement above and the NHibernate mappings. It is not concrete SQL from source code; NHibernate generates the executed statement at runtime, so aliases, column order, join syntax, and bind-parameter names may differ.

```sql
-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
UPDATE LC_POLICY_SERVICE_PLAN
SET
  EXP_DATE = :ExpirationDate,
  LC_SERVICE_PLAN_CODE = :ServicePlanCode,
  CREATE_USER = :CreateUser,
  CREATED_DATE = :CreateDate,
  UPDATE_USER = :UpdateUser,
  UPDATE_DATE = :UpdateDate
WHERE POLICY_NUM = :PolicyNumber
  AND EFF_DATE = :EffectiveDate
```

Translation notes:

- No `Version(...)` mapping, so the UPDATE has no optimistic-concurrency predicate.
- `Update(entity)` emits an explicit UPDATE of every updatable mapped column (no `DynamicUpdate()` on this map).

## Operations and processes
- RctServicePlanService.ExpireServicePlan — see [Operations and processes](../operations-processes.md)

## Sources
- `Services/SAIF.Services/Rct/RctServicePlanService.cs (L263)`
