---
title: "SQL-030: Retrieve IMGSYS row by TOWID"
summary: Retrieves a single IMGSYS imaging system record by its TOWID primary key.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Business.Imaging
reference_type: package
---

# SQL-030: Retrieve IMGSYS row by TOWID

This statement retrieves a single `IMGSYS` row filtered by `TOWID`. Executed by `clsImgsys.BeforeRetrieve`.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:Towid` | Input | [not specified]** | N/A | Primary key: the TOWID of the IMGSYS row to retrieve. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [IMGSYS](../database-tables.md#imgsys) | SELECT | BATID, CRTRID, DELCD, IDXFL, IFNDS, IFNID, NPAGES, SCANDT, SLEVEL, TOWID, UPDRID, UPDTTS |

## Sample SQL

```sql
Select
    IMGSYS.BATID as Batid,
    IMGSYS.CRTRID as Crtrid,
    IMGSYS.DELCD as Delcd,
    IMGSYS.IDXFL as Idxfl,
    IMGSYS.IFNDS as Ifnds,
    IMGSYS.IFNID as Ifnid,
    IMGSYS.NPAGES as Npages,
    IMGSYS.SCANDT as Scandt,
    IMGSYS.SLEVEL as Slevel,
    IMGSYS.TOWID as Towid,
    IMGSYS.UPDRID as Updrid,
    IMGSYS.UPDTTS as Updtts
From IMGSYS
Where TOWID = :TowId
```

## Operations and processes
- [Imaging system management](../operations/imaging-system-management.md)

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `Business\SAIF.Business.Imaging\clsImgsys.vb`
