---
title: "SQL-031: Read PERSON, COMPANY_PERSON for `clsContactCollection`"
summary: Read statement for `clsContactCollection` against PERSON, COMPANY_PERSON.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business.CustomerContact
reference_type: package
---

# SQL-031: Read PERSON, COMPANY_PERSON for `clsContactCollection`

This statement supports `clsContactCollection` by executing a read operation against PERSON, COMPANY_PERSON.

## Classification

| Field | Value |
| --- | --- |
| SQL ID | SQL-031 |
| Operation type | Read |
| Execution method | Dynamic inline |
| Database | Oracle |
| Schema | `[unqualified]**` |
| Command type | Text |
| Business object | `clsContactCollection` |
| Criteria property | SearchForContacts |
| Lifecycle method | SearchForContacts |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:NameSearchString` | Input | String | var | Formatted customer/contact name search string |
| `:FirstName` | Input | String | var | Formatted first-name search string or contact first name |
| `:LastName` | Input | String | var | Formatted last-name search string or contact last name |
| `:RelCode` | Input | String | 5 | Relationship type filter |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [PERSON](../database-tables.md#person) | SELECT / JOIN | ACTIVE_FLAG, ALIAS_NAME, ANNIVERSARY_DATE, BIRTH_DATE, CREATE_DATE, CREATE_USER, DRIVERS_LICENSE_NUM, DRIVERS_LICENSE_STATE, EFF_DT, ETHNIC_GROUP_CODE, EXP_DT, FIRST_NAME, GENDER_CODE, LAST_NAME, MAIDEN_NAME, MARRIED_NAME, MIDDLE_INITIAL, NAME, NAME_EXTENSION, NICK_NAME, NOTE_TEXT, PERSON_SEQ_NUM, PREFERRED_NAME, PRIMARY_FLAG, TAX_ID, UPDATE_DATE, UPDATE_USER |
| [COMPANY_PERSON](../database-tables.md#company-person) | SELECT / JOIN | See sample SQL** |

## Sample SQL

```sql
Select PERSON.PERSON_SEQ_NUM as ContactID, PERSON.NAME as Name, PERSON.LAST_NAME as LastName, PERSON.FIRST_NAME as FirstName, PERSON.MIDDLE_INITIAL as MiddleInitial, PERSON.MARRIED_NAME as MarriedName, PERSON.MAIDEN_NAME as MaidenName, PERSON.NICK_NAME as NickName, PERSON.ALIAS_NAME as AliasName, PERSON.DRIVERS_LICENSE_NUM as DriversLicenseNumber, PERSON.DRIVERS_LICENSE_STATE as DriversLicenseState, PERSON.BIRTH_DATE as BirthDate, PERSON.TAX_ID as TaxID, PERSON.GENDER_CODE as GenderCode, PERSON.ETHNIC_GROUP_CODE as EthnicGroupCode, PERSON.CREATE_DATE as CreateDate, PERSON.CREATE_USER as CreateUser, PERSON.UPDATE_USER as UpdateUser, PERSON.UPDATE_DATE as UpdateDate, PERSON.NAME_EXTENSION as NameExtension, PERSON.EFF_DT as EffectiveDate, PERSON.EXP_DT as ExpirationDate, PERSON.ACTIVE_FLAG as IsActive, PERSON.PRIMARY_FLAG as IsPrimary, PERSON.ANNIVERSARY_DATE as AnniversaryDate, PERSON.PREFERRED_NAME as PreferredName, PERSON.NOTE_TEXT as NoteText From Person WHERE ROWNUM < [runtime ContactLimit + 1]** AND Upper(PERSON.Name) like :NameSearchString AND UPPER(PERSON.FIRST_NAME) like :FirstName AND UPPER(PERSON.LAST_NAME) like :LastName AND PERSON_SEQ_NUM in (SELECT PERSON_SEQ_NUM from COMPANY_PERSON Where RELATIONSHIP_CODE = :RelCode)
```

## Operations and processes
- [Customer/contact search](../operations/customer-contact-search.md)

## Business rules
- [BR-001: Search requires at least one populated criterion](../business-rules.md#br-001-search-requires-at-least-one-populated-criterion)
- [BR-002: Search results are capped at 300](../business-rules.md#br-002-search-results-are-capped-at-300)

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

## Sources
- `Business\SAIF.Business.CustomerContact\Contact\clsContact.vb`
