---
title: SQL-030: Insert Provider Relationship
summary: Inserts a new provider relationship record into Oracle.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business.Provider
reference_type: package
---

# SQL-030: Insert Provider Relationship

Inserts a new provider relationship record into Oracle.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-030 |
| **Operation type** | Create |
| **Execution method** | Inline |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | Text |
| **Business object** | `clsProviderRelationship` |
| **Criteria property** | `InsertSQL` |
| **Lifecycle method** | `BeforeInsert` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| :ProviderLocationSeqNum | Input | Decimal | N/A | Value from `ProviderLocationSeqNum` |
| :ParentProviderLocSeqNum | Input | Decimal | N/A | Value from `ParentProviderLocSeqNum` |
| :ProviderRelationshipCode | Input | String | 5 | Value from `ProviderRelationshipCode` |
| :EffDate | Input | Date | N/A | Value from `EffDate` |
| :ExpDate | Input | clsSmartDate | N/A | Value from `m_ExpDate` |
| :UpdateUser | Input | String | 30 | Value from `UpdateUser` |
| :UpdateNum | Input | Decimal | N/A | Value from `UpdateNum` |
| :UpdateDate | Input | Date | N/A | Value from `UpdateDate` |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [PROVIDER_RELATIONSHIP](../database-tables.md#provider_relationship) | INSERT | See business-object criteria for key columns. |

## Sample SQL

```sql
Insert into PROVIDER_RELATIONSHIP ( PROVIDER_LOCATION_SEQ_NUM, PARENT_PROVIDER_LOC_SEQ_NUM, PROVIDER_RELATIONSHIP_CODE, EFF_DATE, EXP_DATE, UPDATE_USER, UPDATE_NUM, UPDATE_DATE ) Values ( :ProviderLocationSeqNum, :ParentProviderLocSeqNum, :ProviderRelationshipCode, :EffDate, :ExpDate, :UpdateUser, :UpdateNum, :UpdateDate)
```


## Operations and processes
- [Maintain provider relationship](../operations/maintain-provider-relationship.md)

## Business rules
- [BR-013: Relationship participants must exist and be distinct](../business-rules.md#br-013-relationship-participants-must-exist-and-be-distinct)
- [BR-014: Relationship dates must be valid and non-overlapping](../business-rules.md#br-014-relationship-dates-must-be-valid-and-non-overlapping)

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

## Sources
- `Business\SAIF.Business.Provider\clsProviderRelationship.vb`
