---
title: "SQL-007: Look up image sequence number"
summary: Application-layer scalar query that returns the distinct output-log image sequence number.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Correspondence
reference_type: package
---

# SQL-007: Look up image sequence number

This scalar query bypasses the BOF criteria pattern and directly interrogates `OUTPUT_LOG` for the image sequence number attached to a correspondence item.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-007 |
| **Operation type** | Read |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | Text |
| **Business object** | N/A (Application layer) |
| **Criteria property** | N/A |
| **Lifecycle method** | `GetImageSequenceNumber` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| :CorrespondenceSequenceNumber | Input | Decimal (NUMBER) | — | OUTPUT_LOG correspondence sequence number filter. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [OUTPUT_LOG](../database-tables.md#output_log) | SELECT | IMAGE_SEQ_NUM, CORRESPOND_SEQ_NUM |

## Sample SQL

```sql
SELECT DISTINCT(image_seq_num)
FROM output_log
WHERE correspond_seq_num = :CorrespondenceSequenceNumber
```

## Operations and processes
- [Look up a correspondence image sequence number](../operations/look-up-a-correspondence-image-sequence-number.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.Policy.Correspondence\clsCorrespondence.vb`
