---
title: "SQL-012: Retrieve application code by key"
summary: Retrieves a single BUSONLINE_APPS_CODE record by CODE.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business.Menu
reference_type: package
---

# SQL-012: Retrieve application code by key

Retrieves a single application code record from `BUSONLINE_APPS_CODE` by its `CODE` key. `ACTIVE_CODE` is returned with a default of `'Y'` when null.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-012 |
| **Operation type** | Read |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | Text |
| **Business object** | `clsApplicationCode` |
| **Criteria property** | `RetrieveSQL` |
| **Lifecycle method** | `BeforeRetrieve` / `AfterRetrieve` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:Code` | Input | String** | 5 | Application code key bound from `MyCriteria.Code`. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [BUSONLINE_APPS_CODE](../database-tables.md#busonline-apps-code) | SELECT | `CODE`, `CODE_DESCR`, `ACTIVE_CODE` |

## Sample SQL

```sql
SELECT CODE as Code,
       CODE_DESCR as ApplicationPath,
       NVL(ACTIVE_CODE,'Y') as ActiveFlag
FROM BUSONLINE_APPS_CODE
Where CODE = :Code
```

## Operations and processes
- [Application code scoping](../operations/application-code-scoping.md)



> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `Business\SAIF.Business.Menu\clsApplicationCode.vb`
