---
title: "SQL-162: Retrieve DocumentOutputProfileCode via GetDocumentOutputProfileCodes"
summary: Read operation against DocumentOutputProfileCode via NHibernate ORM.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# SQL-162: Retrieve DocumentOutputProfileCode via GetDocumentOutputProfileCodes

This statement performs an unfiltered read of the `DOCUMENT_OP_CODE` lookup table, materializing every document output-profile code available for template configuration.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-162 |
| **Operation type** | Read |
| **Execution method** | ORM (NHibernate LINQ) |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | N/A (ORM-generated) |
| **Business object** | `DocumentOutputProfileCode` |
| **Criteria property** | N/A — ORM |
| **Lifecycle method** | `GetDocumentOutputProfileCodes` |

## Parameters

None (unfiltered full-table read).

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [DOCUMENT_OP_CODE](../database-tables.md#document_op_code) | SELECT | CODE, CODE_DESCR, UPDATE_DATE, UPDATE_USER, UPDATE_NUM |

## LINQ statement

Source: `Services/SAIF.Services/Documents/TemplateSearchService.cs:108`

```csharp
var codeRecords = unitOfWork.GetRepository<DocumentOutputProfileCode>().Query().ToList();
```

## Sample SQL

> **Inferred SQL:** This SQL was inferred from the LINQ statement above and the NHibernate mappings. It is not concrete SQL from source code; NHibernate generates the executed statement at runtime, so aliases, column order, join syntax, and bind-parameter names may differ.

```sql
-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
SELECT DOPC.CODE,
       DOPC.CODE_DESCR,
       DOPC.UPDATE_DATE,
       DOPC.UPDATE_USER,
       DOPC.UPDATE_NUM
FROM   DOCUMENT_OP_CODE DOPC;
```

Translation notes:
- Unfiltered full-table read materialized by `ToList()`.

## Operations and processes
- TemplateSearchService.GetDocumentOutputProfileCodes — see [Operations and processes](../operations-processes.md)

## Sources
- `Services/SAIF.Services/Documents/TemplateSearchService.cs (L108)`
