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

# SQL-029: BillQueryProvider.GetBillStatusCode

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

## Classification

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

## Parameters

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

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [CBP_BILL_STATUS_CODE](../database-tables.md#cbp_bill_status_code) | SELECT | CODE, UPDATE_NUM, CODE_DESCR, ACTIVE_FLAG, EXT_IW_CODE_DESCR, UPDATE_DATE, UPDATE_USER |

## LINQ statement

Source: `Data/SAIF.Data/Queries/Claims/BillQueryProvider.cs:60`.

```csharp
return Factory.GetRepository<CbpBillStatusCode>().Query()
    .SingleOrDefault(x => x.Code == status);
```

## 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
  CBSC.CODE,
  CBSC.UPDATE_NUM,
  CBSC.CODE_DESCR,
  CBSC.ACTIVE_FLAG,
  CBSC.EXT_IW_CODE_DESCR,
  CBSC.UPDATE_DATE,
  CBSC.UPDATE_USER
FROM CBP_BILL_STATUS_CODE CBSC
WHERE CBSC.CODE = :status
-- NHibernate expects at most one row
```

## Operations and processes

- [Bill queries](../operations/bill-queries.md)

## Business rules

- [SD-BR-034 Bill entry source classification](../business-rules.md#sd-br-034-bill-entry-source-classification)
- [SD-BR-035 Bill allowed total treats null as zero](../business-rules.md#sd-br-035-bill-allowed-total-treats-null-as-zero)
- [SD-BR-036 Service code current only when expiration date is null](../business-rules.md#sd-br-036-service-code-current-only-when-expiration-date-is-null)

## Sources
- `Data/SAIF.Data/Queries/Claims/BillQueryProvider.cs:60`
