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

# SQL-045: Create RctPolicyServicePlan via InsertServicePlan

This ORM statement performs a create operation on `RctPolicyServicePlan` via `InsertServicePlan`, executed from `Services/SAIF.Services/Rct/RctServicePlanService.cs` (L289).

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:PolicyNumber` | Input | `long` | N/A | Composite-key part |
| `:EffectiveDate` | Input | `DateTime` | N/A | Composite-key part |
| `:ExpirationDate` | Input | `DateTime?` | N/A |  |
| `:ServicePlanCode` | Input | `string` | N/A |  |
| `:CreateUser` | Input | `string` | N/A |  |
| `:CreateDate` | Input | `DateTime` | N/A |  |
| `:UpdateUser` | Input | `string` | N/A |  |
| `:UpdateDate` | Input | `DateTime?` | N/A |  |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [LC_POLICY_SERVICE_PLAN](../database-tables.md#lc_policy_service_plan) | INSERT | 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:289`.

```csharp
// Services/SAIF.Services/Rct/RctServicePlanService.cs:289
_unitOfWork.GetRepository<Model.Rct.RctPolicyServicePlan>().Add(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
INSERT INTO LC_POLICY_SERVICE_PLAN (
  POLICY_NUM,
  EFF_DATE,
  EXP_DATE,
  LC_SERVICE_PLAN_CODE,
  CREATE_USER,
  CREATED_DATE,
  UPDATE_USER,
  UPDATE_DATE)
VALUES (
  :PolicyNumber,
  :EffectiveDate,
  :ExpirationDate,
  :ServicePlanCode,
  :CreateUser,
  :CreateDate,
  :UpdateUser,
  :UpdateDate)
```

Translation notes:
- Composite identifier (`CompositeId()`) with no generator: every key part is supplied by the caller. A stateful `SaveOrUpdate` on a composite-key entity may first issue a `SELECT` by the key columns to decide between INSERT and UPDATE.

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

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

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