---
title: "SQL-050: clsUserType"
summary: Update statement for clsUserType.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Business.External.Users
reference_type: package
---

# SQL-050: clsUserType

Updates an existing `EXT_USER_TYPE` row with 14 parameters. The WHERE clause includes `AND update_num = :UpdateNum` per [BR-EU-05](../business-rules.md#br-eu-05-optimistic-concurrency-via-update_num).

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-050 |
| **Operation type** | Update |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | Text |
| **Business object** | `clsUserType` |
| **Criteria property** | `UpdateSQL` |
| **Lifecycle method** | `BeforeUpdate` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:UserTypeID` | Input | Decimal | N/A | Primary key (also in WHERE). |
| `:UserID` | Input | Decimal | N/A | Owning user sequence. |
| `:CustomerID` | Input | Decimal | N/A | Company sequence. |
| `:UserTypeCode` | Input | String | 5 | User type code. |
| `:SourceSystemID` | Input | String | 30 | Customer ID (upper-cased). |
| `:SourceSystemGroupID` | Input | String | 30 | Customer group ID (upper-cased). |
| `:Credential1ID` | Input | Decimal | N/A | First credential identifier. |
| `:Credential2ID` | Input | Decimal | N/A | Second credential identifier. |
| `:IsPrimaryType` | Input | String | 1 | Primary type flag. |
| `:IsAdminUser` | Input | String | 1 | Admin user flag. |
| `:IsSteward` | Input | String | 1 | Steward flag. |
| `:UpdateUser` | Input | String | 30 | Username performing update. |
| `:UpdateDate` | Input | DateTime | N/A | Update timestamp. |
| `:UpdateNum` | Input | Decimal | N/A | Current optimistic-concurrency value. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [EXT_USER_TYPE](../database-tables.md#ext_user_type) | UPDATE | All columns except CREATE_USER/CREATE_DATE |

## Sample SQL

```sql
UPDATE EXT_USER_TYPE
SET EXT_USER_TYPE_SEQ_NUM = :UserTypeID,
    EXT_USER_SEQ_NUM = :UserID,
    COMPANY_SEQ_NUM = :CustomerID,
    EXT_USER_TYPE_CODE = :UserTypeCode,
    CUSTOMER_ID = upper(:SourceSystemID),
    CUSTOMER_GROUP_ID = upper(:SourceSystemGroupID),
    CREDENTIAL_1_ID = :Credential1ID,
    CREDENTIAL_2_ID = :Credential2ID,
    PRIMARY_TYPE_FLAG = :IsPrimaryType,
    ADMIN_USER_FLAG = :IsAdminUser,
    STEWARD_FLAG = :IsSteward,
    UPDATE_USER = :UpdateUser,
    UPDATE_DATE = :UpdateDate,
    UPDATE_NUM = :UpdateNum + 1
WHERE EXT_USER_TYPE.EXT_USER_TYPE_SEQ_NUM = :UserTypeID
  AND update_num = :UpdateNum
```

## Operations and processes
- [User type management](../operations/user-type-management.md)

## Business rules
- [BR-EU-05: Optimistic concurrency via UPDATE_NUM](../business-rules.md#br-eu-05-optimistic-concurrency-via-update_num)

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