---
title: "SQL-020: CollectionsRepository.GetWorkerIdForSoilTrans"
summary: Read operation for CollectionsRepository
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data.NHibernate
reference_type: package
---


# SQL-020: CollectionsRepository.GetWorkerIdForSoilTrans

This statement is a read operation invoked through Inline (named SQL query Collections_getWorkerIdForSoilTrans). Executed by `CollectionsRepository.GetWorkerIdForSoilTrans`.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-020 |
| **Operation type** | Read |
| **Execution method** | Inline (named SQL query `Collections_getWorkerIdForSoilTrans`) |
| **Database** | Oracle |
| **Schema** | WCIS_DBA* (package owner; unqualified inside package); [unqualified]** |
| **Command type** | Text |
| **Business object** | `CollectionsRepository` |
| **Criteria property** | N/A — no IBusinessCriteria |
| **Lifecycle method** | `GetWorkerIdForSoilTrans` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:create_date_in` | Input | DateTime (compared with `TRUNC`) | N/A | SOIL run create date |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [SOIL_DEBTOR_REFERENCE](../database-tables.md#soil_debtor_reference) | Read | See Sample SQL |
| [LEGAL_COLLECTION](../database-tables.md#legal_collection) | Read | See Sample SQL |
| [LEGAL_COLLECTION_DEBTOR](../database-tables.md#legal_collection_debtor) | Read | See Sample SQL |

## Sample SQL

Source: `Data/SAIF.Data.NHibernate/Mappings/Collections/Collections.hbm.xml:83`

```sql
      SELECT distinct d.worker_id
      FROM soil_debtor_reference r, legal_collection l
      JOIN legal_collection_debtor d ON l.LEGAL_COLLECTION_SEQ_NUM = d.LEGAL_COLLECTION_SEQ_NUM
      WHERE d.worker_id IS NOT NULL
      AND NVL(d.loc_seq_num,0) = 0
      AND r.LEGAL_COLL_debtor_SEQ_NUM = d.LEGAL_COLL_debtor_SEQ_NUM
      AND TRUNC(r.create_date) = TRUNC(:create_date_in)
```

## Operations and processes

- [SOIL (State of Oregon Intercept) processing](../operations/soil-processing.md)

## Business rules

- [SDN-BR-012](../business-rules.md#sdn-br-012-soil-transactions-are-selected-by-the-truncated-create-date)

> **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
- `Data/SAIF.Data.NHibernate/Repositories/CollectionsRepository.cs:145`
