---
title: "SQL-012: CollectionsRepository.SearchCollections"
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-012: CollectionsRepository.SearchCollections

This statement is a read operation invoked through StoredProc (named query Collections_SearchCollections). Executed by `CollectionsRepository.SearchCollections`.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:last_name_in` | Input | VARCHAR2 | N/A** | Debtor last name |
| `:first_name_in` | Input | VARCHAR2 | N/A** | Debtor first name |
| `:ssn_in` | Input | VARCHAR2 | N/A** | Debtor SSN (PII) |
| `:policy_name_in` | Input | VARCHAR2 | N/A** | Policy / company name |
| `:show_closed_cases_in` | Input | VARCHAR2 ('Y'/'N') | 1* | Include zero-balance cases |
| `:run_id_in` | Input | VARCHAR2 | N/A** | Run id filter for CLM_DBA.TEMP_DATA_PERSON_ADDRESS |
| `recordset` | Output | REF CURSOR → `SearchResult` | N/A | Result set |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [LEGAL_COLLECTION](../database-tables.md#legal_collection) | Read | See Sample SQL |
| [LEGAL_COLLECTION_DEBTOR](../database-tables.md#legal_collection_debtor) | Read | See Sample SQL |
| [CLM_DBA.TEMP_DATA_PERSON_ADDRESS](../database-tables.md#clm_dba.temp_data_person_address) | Read | See Sample SQL |
| [AFFILIATE](../database-tables.md#affiliate) | Read | See Sample SQL |
| [THRDPARTY](../database-tables.md#thrdparty) | Read | See Sample SQL |
| [THRDPARTY_FIRM](../database-tables.md#thrdparty_firm) | Read | See Sample SQL |
| [PERSON](../database-tables.md#person) | Read | See Sample SQL |
| [COMPANY](../database-tables.md#company) | Read | See Sample SQL |
| [POLICY](../database-tables.md#policy) | Read | See Sample SQL |
| [POLICY_SEARCH](../database-tables.md#policy_search) | Read | See Sample SQL |
| [MARKET_TYPE_CODE](../database-tables.md#market_type_code) | Read | See Sample SQL |

## Sample SQL

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

```sql
{ call PK80010_LEGAL_COLLECTIONS.SEARCH_COLLECTIONS(
    :last_name_in,
    :first_name_in,
    :ssn_in,
    :policy_name_in,
    :show_closed_cases_in,
    :run_id_in
) }
```

## Operations and processes

- [Collections case lookups](../operations/collections-case-lookups.md)

## Business rules

- [PROC-RULE-010](../business-rules.md#proc-rule-010-closed-cases-are-hidden-unless-requested)
- [PROC-RULE-011](../business-rules.md#proc-rule-011-search-branch-selection)

> **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:74`
