---
title: "SQL-009: clsXDeferredPrint.RetrieveSQL (dead code)"
summary: Retrieve a single deferred print item — not wired to any live lifecycle method.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Services.Printing.Remote
reference_type: package
---

# SQL-009: clsXDeferredPrint.RetrieveSQL (dead code)

This SQL property in `clsXDeferredPrint.Criteria` is a hard `Throw` (`ApplicationException(clsConstants.Messages.InvalidSQLProperty)`) — it returns no executable SQL text. The corresponding `BeforeRetrieve` and `AfterRetrieve` overrides in this class are fully commented out. Single-item deferred print retrieval is not a live operation in this library; collection-level retrieval is handled by `clsXDeferredPrintCollection` via SQL-010.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-009 |
| **Operation type** | Read (Retrieve) |
| **Execution method** | Inline (⚠️ not wired to live `BeforeRetrieve`/`AfterRetrieve` methods — both are fully commented out; property itself is a hard `Throw`) |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | Text |
| **Business object** | `clsXDeferredPrint` |
| **Criteria property** | `RetrieveSQL` |
| **Lifecycle method** | `BeforeRetrieve` / `AfterRetrieve` (commented out) |

## Parameters

No live SQL text or `AddParm` calls exist. The commented-out `BeforeRetrieve` contains a single intended parameter:

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:XdeferredSeqNum` | Input | Decimal* | — | Primary key lookup (inferred from commented-out `BeforeRetrieve`) |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [XDEFERRED_PRINT](../database-tables.md#xdeferred_print) | SELECT (intended — not executed) | `XDEFERRED_SEQ_NUM` (inferred from commented-out code)* |

## Sample SQL

```sql
-- This property is a hard Throw — no executable SQL text is returned.
-- The BeforeRetrieve/AfterRetrieve overrides that would execute a SELECT
-- are fully commented out in clsXDeferredPrint.vb.
-- Collection-level retrieval is handled by SQL-010 (clsXDeferredPrintCollection.RetrieveSQL).
Throw New ApplicationException(clsConstants.Messages.InvalidSQLProperty)
```

> **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
- `Services\SAIF.Services.Printing.Remote\clsXDeferredPrint.vb`
