---
title: "SQL-364: Delete CbpAuthorization via DeleteAuthorization"
summary: Delete operation against CbpAuthorization via NHibernate ORM.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# SQL-364: Delete CbpAuthorization via DeleteAuthorization

This ORM statement deletes a `CBP_AUTHORIZATION` row for a previously loaded authorization, executed from `Services/SAIF.Services/Claims/Bills/AuthorizationService.cs (L289)`. The SQL below is inferred from the `IRepository<CbpAuthorization>.Delete` call and the `CbpAuthorization` NHibernate mapping, not literal SQL text in source.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:Id` | Input | long | N/A | Identifier of the CbpAuthorization being deleted (`CBP_AUTHORIZATION_SEQ_NUM`) |
| `:oldVersion` | Input | int | N/A | Current `UPDATE_NUM` value (optimistic-concurrency check) |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [CBP_AUTHORIZATION](../database-tables.md#cbp_authorization) | DELETE | `CBP_AUTHORIZATION_SEQ_NUM`, `UPDATE_NUM` |

## LINQ statement

Source: `Services/SAIF.Services/Claims/Bills/AuthorizationService.cs:289`

```csharp
// Services/SAIF.Services/Claims/Bills/AuthorizationService.cs:289
unitOfWork.GetRepository<CbpAuthorization>().Delete(authorization);
```

## 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
DELETE FROM CBP_AUTHORIZATION
WHERE CBP_AUTHORIZATION_SEQ_NUM = :Id
  AND UPDATE_NUM = :oldVersion
```

Translation notes:

- `Version(x => x.UpdateNumber).Column("UPDATE_NUM")` adds the old-version predicate to the DELETE.

## Operations and processes
- AuthorizationService.DeleteAuthorization — see [Operations and processes](../operations-processes.md)

## Sources
- `Services/SAIF.Services/Claims/Bills/AuthorizationService.cs (L289)`
