---
title: "SQL-005: Task category combination validation"
summary: Counts matching category rows to validate a source/category combination.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business.Tasks
reference_type: package
---

# SQL-005: Task category combination validation

Counts matching category rows to validate a source/category combination.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-005 |
| **Operation type** | Read |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | Text |
| **Business object** | `clsTaskBusinessRules` |
| **Criteria property** | N/A |
| **Lifecycle method** | `ValidSourceCategory` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:Source` | Input | String | 5 | Source system code. |
| `:Category` | Input | String | 5 | Category code. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [TASK_CATEGORY_CODE](../database-tables.md#task_category_code) | SELECT | TASK_SOURCE_CODE, CODE |

## Sample SQL

```sql
SELECT Count(*)
FROM Task_Category_Code
WHERE TASK_SOURCE_CODE = :Source
  AND CODE = :Category
```

## Operations and processes
- [Task record lifecycle](../operations/task-record-lifecycle.md)

## Business rules
- [BR-001](../business-rules.md#br-001-valid-source-and-category-combination)

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

## Sources
- `Business\SAIF.Business.Tasks\clsTaskBusinessRules.vb`

