---
title: SQL-013: Child provider relationships by location
summary: Child provider relationships by location retrieval query.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-24
library: SAIF.Business.View.Provider
reference_type: package
---

# SQL-013: Child provider relationships by location

This statement supports the ``clsProviderRelationshipCollection`` retrieval path by reading provider-domain data from Oracle tables and projecting the result into business objects or DTO lists.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-013 |
| **Operation type** | Read |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | Text |
| **Business object** | ``clsProviderRelationshipCollection`` |
| **Criteria property** | ``RetrieveSQL`` |
| **Lifecycle method** | `BeforeRetrieve` (`GetChildProviderRelationshipCollection`) |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:ProviderLocationID` | Input | Decimal | N/A | Retrieves child provider-location relationships for the selected parent location. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [PROVIDER_LOCATION](../database-tables.md#provider_location) | SELECT | PROVIDER_LOCATION_SEQ_NUM, PROVIDER_SEQ_NUM, PROVIDER_TYPE_CODE |
| [PROVIDER_RELATIONSHIP](../database-tables.md#provider_relationship) | SELECT | PROVIDER_LOCATION_SEQ_NUM, PARENT_PROVIDER_LOC_SEQ_NUM, PROVIDER_RELATIONSHIP_CODE |

## Sample SQL

```sql
SELECT
  PR.Provider_Location_Seq_Num AS PRProviderLocationID,
  PR.PARENT_PROVIDER_LOC_SEQ_NUM AS ParentProviderLocationID,
  PR.EFF_DATE AS StartDate,
  PR.EXP_DATE AS TerminationDate,
  PR.PROVIDER_RELATIONSHIP_CODE AS ProviderRelationshipCode,
  PL.APPROVED_FLAG AS IsApproved,
  PL.APPROVED_USER AS ApprovedUser,
  PL.BUSINESS_FLAG AS IsBusiness,
  PL.BUSINESS_NAME AS BusinessName,
  PL.FAX_NUM AS FaxNum,
  PL.FIRST_NAME AS FirstName,
  PL.INELIGIBILITY_FLAG AS IsIneligible,
  PL.LAST_NAME AS LastName,
  PL.MIDDLE_NAME AS MiddleName,
  PL.PAYEE_NAME AS PayeeName,
  PL.PHONE_AREA_CODE AS PhoneAreaCode,
  PL.PHONE_NUM AS PhoneNum,
  PL.PHONE_NUM_EXT AS PhoneNumExt,
  PL.POSSIBLE_FRAUD_FLAG AS IsPossibleFraud,
  PL.PRIMARY_LOCATION_FLAG AS IsPrimaryLocation,
  PL.PROVIDER_LOCATION_SEQ_NUM AS ProviderLocationID,
  PL.PROVIDER_SEQ_NUM AS ProviderID,
  PL.PROVIDER_TYPE_CODE AS ProviderTypeCode,
  PL.RECENT_ACTIVITY_FLAG AS HasRecentActivity,
  PL.TOLL_FREE_FAX_NUM AS TollFreeFaxNum,
  PL.TOLL_FREE_PHONE_NUM AS TollFreePhoneNum,
  PL.CRITICAL_ACCESS_HOSPITAL_FLAG AS IsCriticalAccessHospital,
  PL.UPDATE_DATE AS UpdateDate,
  PL.UPDATE_NUM AS UpdateNum,
  PL.UPDATE_USER AS UpdateUser,
  PL.WEB_SITE_ADDRESS AS WebSiteAddress,
  PL.EMAIL_ADDR AS EmailAddress
FROM provider_location pl
JOIN provider_relationship pr ON pr.provider_location_seq_num = PL.provider_location_seq_num
LEFT JOIN provider_location parentPL ON parentPL.provider_location_seq_num = pr.parent_provider_loc_seq_num
WHERE parentpl.provider_location_seq_num = :ProviderLocationID
ORDER BY PL.BUSINESS_NAME
```

## Operations and processes
- [Retrieve child provider relationships](../operations/provider-relationship-retrieval.md)

## Related documentation
- [Index](../index.md)
- [Overview](../overview.md)
- [Architecture](../architecture.md)
- [Dependencies](../dependencies.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Database tables](../database-tables.md)
- [SQL catalog](../sql/index.md)
- [API reference](../api/index.md)

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown until verified.
## Sources
- `Business\SAIF.Business.View.Provider\clsProviderRelationshipCollection.vb`
