---
title: "SQL-001: Retrieve help text by application code and reference key"
summary: Reads one help entry joining the master and detail help tables by reference key.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Controls.AJAX.Infragistics111
reference_type: package
---

# SQL-001: Retrieve help text by application code and reference key

This statement retrieves a single help entry — its reference-key description and free-text help body — by joining `APPLICATION_HELP_MASTER` to `APPLICATION_HELP_DETAIL` on the reference key value, filtered by application code and reference key value. It backs `clsHelpText.GetHelpText`, which feeds the `HoverHelp` control's content.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-001 |
| **Operation type** | Read |
| **Execution method** | Inline SQL (VB `& _` string concatenation) |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | Text |
| **Business object** | `clsHelpText` |
| **Criteria property** | `RetrieveSQL` |
| **Lifecycle method** | `BeforeRetrieve` / `AfterRetrieve` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:ApplicationCode` | Input | String | 5 | Application code identifying the owning application; supplied to `clsHelpText.GetHelpText(dpi, inApplicationCode, inReferenceKeyValue)`. Bound in `BeforeRetrieve` via `DataRequest.AddParm("ApplicationCode", MyCriteria.ApplicationCode, 5)`. |
| `:ReferenceKeyValue` | Input | String | 40 | Reference key identifying the specific help entry (typically a control/field key). Bound in `BeforeRetrieve` via `DataRequest.AddParm("ReferenceKeyValue", MyCriteria.ReferenceKeyValue, 40)`. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [APPLICATION_HELP_MASTER](../database-tables.md#application_help_master) | SELECT, JOIN | `APPLICATION_CODE`, `REFERENCE_KEY_DESCR`, `REFERENCE_KEY_VALUE` |
| [APPLICATION_HELP_DETAIL](../database-tables.md#application_help_detail) | SELECT, JOIN | `HELP_TEXT`, `REFERENCE_KEY_VALUE` |

## Sample SQL

```sql
-- Retrieve one help entry by application code and reference key
Select
  APPLICATION_HELP_MASTER.APPLICATION_CODE as ApplicationCode,
  APPLICATION_HELP_MASTER.REFERENCE_KEY_DESCR as ReferenceKeyDescription,
  APPLICATION_HELP_MASTER.REFERENCE_KEY_VALUE as ReferenceKeyValue,
  APPLICATION_HELP_DETAIL.HELP_TEXT as HelpText
From
  APPLICATION_HELP_MASTER,
  APPLICATION_HELP_DETAIL
Where
  APPLICATION_HELP_MASTER.REFERENCE_KEY_VALUE = APPLICATION_HELP_DETAIL.REFERENCE_KEY_VALUE
  AND APPLICATION_HELP_MASTER.APPLICATION_CODE = :ApplicationCode
  AND APPLICATION_HELP_MASTER.REFERENCE_KEY_VALUE = :ReferenceKeyValue
```

## Operations and processes
- [Load help text from the database](../operations/load-help-text-from-the-database.md)

## Business rules
- [BR-AJAX-017: Help text is identified by an application code and reference key with length ceilings](../business-rules.md#br-ajax-017-help-text-is-identified-by-an-application-code-and-reference-key-with-length-ceilings)
- [BR-AJAX-018: Help content is assembled by joining master and detail on the reference key](../business-rules.md#br-ajax-018-help-content-is-assembled-by-joining-master-and-detail-on-the-reference-key)
- [BR-AJAX-019: A help lookup that matches nothing yields empty text, not an error](../business-rules.md#br-ajax-019-a-help-lookup-that-matches-nothing-yields-empty-text-not-an-error)
- [BR-AJAX-020: Filling a help control with a null help object leaves content unchanged](../business-rules.md#br-ajax-020-filling-a-help-control-with-a-null-help-object-leaves-content-unchanged)

## Sources
- `SAIF.Presentation.Web.Controls.AJAX.Infragistics111/clsHelpText.vb`
