---
title: "SQL-230: ServiceCodeQueryProvider.GetProcedureCode"
summary: Read operation for `ServiceCodeQueryProvider.GetProcedureCode`
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
---

# SQL-230: ServiceCodeQueryProvider.GetProcedureCode

This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by `ServiceCodeQueryProvider.GetProcedureCode`.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-230 |
| **Operation type** | Read |
| **Execution method** | ORM (NHibernate LINQ) |
| **Database** | Oracle* |
| **Schema** | [unqualified]** |
| **Command type** | N/A (ORM-generated) |
| **Business object** | `ServiceCodeQueryProvider` |
| **Criteria property** | N/A — ORM |
| **Lifecycle method** | `GetProcedureCode` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `code` | Input | string | N/A | Method argument of `ServiceCodeQueryProvider.GetProcedureCode` bound into the ORM expression; NHibernate generates the bind variable at runtime |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [CBP_PROCEDURE_CODE](../database-tables.md#cbp_procedure_code) | SELECT | CODE, UPDATE_NUM, CODE_DESCR, SHORT_DESCR, EFF_DATE, EXP_DATE, UPDATE_USER, UPDATE_DATE, ICD_VERSION_CODE |

## LINQ statement

Source: `Data/SAIF.Data/Queries/Claims/ServiceCodeQueryProvider.cs:35`.

```csharp
public Model.Claims.Bills.CbpProcedureCode GetProcedureCode(string code)
{
    return Factory.GetRepository<CbpProcedureCode>().Query().FirstOrDefault(x => x.Code == code);
}
```

## 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
SELECT * FROM (
  SELECT
    CPC.CODE,
    CPC.UPDATE_NUM,
    CPC.CODE_DESCR,
    CPC.SHORT_DESCR,
    CPC.EFF_DATE,
    CPC.EXP_DATE,
    CPC.UPDATE_USER,
    CPC.UPDATE_DATE,
    CPC.ICD_VERSION_CODE
  FROM CBP_PROCEDURE_CODE CPC
  WHERE CPC.CODE = :code
) WHERE ROWNUM <= 1
```

Translation notes:
- The mapping class `CbpProcedureCodeMap` lives in file `CbpProcedureCode.cs` (no `Map` suffix in the file name).

## Operations and processes

- [Other query providers](../operations/other-query-providers.md)


## Sources
- `Data/SAIF.Data/Queries/Claims/ServiceCodeQueryProvider.cs:35`
