---
title: "SQL-058: Retrieve entity type"
summary: "Retrieve entity type"
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Core
reference_type: package
---

# SQL-058: Retrieve entity type

Retrieve entity type in the context of `clsEntityType`.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-058 |
| **Operation type** | Read |
| **Execution method** | IDataRequest.SQLStatement (CommandType.Text) |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | Text |
| **Business object** | `clsEntityType` |
| **Criteria property** | `RetrieveSQL` |
| **Lifecycle method** | `BeforeRetrieve / AfterRetrieve` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:Code` | Input | bound from `MyCriteria.Code` | 5 | Bound in `clsEntityType.BeforeRetrieve` (line 427) |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [ENTITY_CODE](../database-tables.md#entity_code) | SELECT | See sample SQL |

## Sample SQL

```sql
SELECT
  ENTITY_CODE.ASSUMED_WAGE_CODE as AssumedWageCode,
  ENTITY_CODE.CHANGE_ALLOWED_FLAG as ChangeAllowedFlag,
  ENTITY_CODE.CHANGE_ENDORSE_CODE as ChangeEndorseCode,
  ENTITY_CODE.CODE as Code,
  ENTITY_CODE.CODE_DESCR as CodeDescr,
  ENTITY_CODE.INC_EXC_ENDORSE_CODE as IncExcEndorseCode,
  ENTITY_CODE.INC_EXC_WAGE_ENDORSE_CODE as IncExcWageEndorseCode,
  ENTITY_CODE.OFFICER_REQUIRED_FLAG as OfficerRequiredFlag,
  ENTITY_CODE.WAGE_CHANGE_ENDORSE_CODE as WageChangeEndorseCode
FROM
  ENTITY_CODE
WHERE
  ENTITY_CODE.CODE = :Code
```

## Operations and processes
- [Determine ownership requirements for an entity type](../operations/determine-ownership-requirements-for-an-entity-type.md)

## Business rules
- [BR-006: Ownership information is required for all entity types](../business-rules.md#br-006-ownership-information-is-required-for-all-entity-types)
- [BR-007: Sole proprietors require exactly one owner; partnerships, limited](../business-rules.md#br-007-sole-proprietors-require-exactly-one-owner-partnerships-limited)
- [BR-008: For the Guidewire path, joint ventures require one](../business-rules.md#br-008-for-the-guidewire-path-joint-ventures-require-one)
- [BR-026: An entity type must have a valid code](../business-rules.md#br-026-an-entity-type-must-have-a-valid-code)

> **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.Core\clsEntityType.vb`
