---
title: "SQL-027: Retrieve deny-self-registration row"
summary: Retrieves a deny-self-registration block-list entry by customer group ID and user type code.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Business.External.Users
reference_type: package
---

# SQL-027: Retrieve deny-self-registration row

Retrieves a `EXT_USER_DENY_SELF_REG` row for a given customer group ID and user type code. The presence of a row indicates the user type/customer-group combination is on the block-list, enforcing [BR-EU-02](../business-rules.md#br-eu-02-deny-self-registration-block-list).

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:SourceSystemGroupID` | Input | String | 30 | Customer group ID (composite key part 1). |
| `:UserTypeCode` | Input | String | 5 | User type code (composite key part 2). |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [EXT_USER_DENY_SELF_REG](../database-tables.md#ext_user_deny_self_reg) | SELECT | All columns |

## Sample SQL

```sql
SELECT
    EXT_USER_DENY_SELF_REG.CUSTOMER_GROUP_ID AS SourceSystemGroupID,
    EXT_USER_DENY_SELF_REG.EXT_USER_TYPE_CODE AS UserTypeCode,
    EXT_USER_DENY_SELF_REG.CUSTOMER_REQUESTED_FLAG AS CustomerRequested,
    EXT_USER_DENY_SELF_REG.REASON_TXT AS Reason,
    EXT_USER_DENY_SELF_REG.CREATE_USER AS CreateUser,
    EXT_USER_DENY_SELF_REG.CREATE_DATE AS CreateDate,
    EXT_USER_DENY_SELF_REG.UPDATE_USER AS UpdateUser,
    EXT_USER_DENY_SELF_REG.UPDATE_DATE AS UpdateDate,
    EXT_USER_DENY_SELF_REG.UPDATE_NUM AS UpdateNum
FROM EXT_USER_DENY_SELF_REG
WHERE EXT_USER_DENY_SELF_REG.CUSTOMER_GROUP_ID = :SourceSystemGroupID
  AND EXT_USER_DENY_SELF_REG.EXT_USER_TYPE_CODE = :UserTypeCode
```

## Operations and processes
- [Deny self-registration check](../operations/deny-self-registration-check.md)

## Business rules
- [BR-EU-02: Deny-self-registration block-list](../business-rules.md#br-eu-02-deny-self-registration-block-list)

> **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.External.Users\clsUserDenySelfRegistration.vb`
