---
title: "SQL-059: clsPaymentDetail retrieve"
summary: Retrieves a single payment detail record from PAYMENT_DETAIL with a joined authorization type code description via PAYMENT_AUTHORIZATION.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business.Payment.EFT
reference_type: package
---

# SQL-059: clsPaymentDetail retrieve

Retrieves a single payment detail record from PAYMENT_DETAIL with a joined authorization type code description via PAYMENT_AUTHORIZATION.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-059 |
| **Operation type** | Read |
| **Execution method** | Inline SQL |
| **Database** | Oracle* |
| **Schema** | [unqualified]** |
| **Command type** | Text |
| **Business object** | `clsPaymentDetail` |
| **Criteria property** | `RetrieveSQL` |
| **Lifecycle method** | `BeforeRetrieve / AfterRetrieve` |


## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| \:PaymentDetailSeqNum\ | Input | Decimal | — | Binds \MyCriteria.PaymentDetailSeqNum\* |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [PAYMENT_DETAIL](../database-tables.md#payment_detail) | Read | All columns |
| [PAYMENT_AUTHORIZATION](../database-tables.md#payment_authorization) | Read (join) | PAYMENT_AUTHORIZATION_SEQ_NUM, AUTHORIZATION_TYPE_CODE |
| [AUTHORIZATION_TYPE_CODE](../database-tables.md#authorization_type_code) | Read (join) | CODE, CODE_DESCR |

## Sample SQL

```sql
Select PAYMENT_DETAIL.ACH_STD_ENTRY_CLASS_CODE as AchStdEntryClassCode,
  PAYMENT_DETAIL.CONFIRMATION_CHECK_NUM as ConfirmationCheckNum,
  PAYMENT_DETAIL.CREATE_DATE as CreateDate,
  PAYMENT_DETAIL.CREATE_USER as CreateUser,
  PAYMENT_DETAIL.CREDIT_DEBIT_CODE as CreditDebitCode,
  PAYMENT_DETAIL.CURRENT_PAYMENT_EVENT_CODE as CurrentPaymentEventCode,
  PAYMENT_DETAIL.NSF_COUNT as NsfCount,
  PAYMENT_DETAIL.ONLINE_PAYMENT_TYPE_CODE as OnlinePaymentTypeCode,
  PAYMENT_DETAIL.PAYMENT_AMT as PaymentAmt,
  PAYMENT_DETAIL.PAYMENT_AUTHORIZATION_SEQ_NUM as PaymentAuthorizationSeqNum,
  PAYMENT_DETAIL.PAYMENT_DATE as PaymentDate,
  PAYMENT_DETAIL.PAYMENT_DETAIL_SEQ_NUM as PaymentDetailSeqNum,
  PAYMENT_DETAIL.PRENOTE_FLAG as PrenoteFlag,
  PAYMENT_DETAIL.RESUBMIT_DATE as ResubmitDate,
  PAYMENT_DETAIL.UPDATE_DATE as UpdateDate,
  PAYMENT_DETAIL.UPDATE_USER as UpdateUser,
  PAYMENT_DETAIL.ACH_ADDENDUM_TEXT as AchAddendumText,
  PAYMENT_DETAIL.PAYMENT_VENDOR_XML_TEXT as PaymentVendorXMLText,
  AUTHORIZATION_TYPE_CODE.CODE_DESCR as AuthTypeDescr
From PAYMENT_DETAIL
  Join payment_authorization ON (payment_detail.payment_authorization_seq_num = payment_authorization.payment_authorization_seq_num)
  Join authorization_type_code ON (payment_authorization.authorization_type_code = authorization_type_code.code)
Where PAYMENT_DETAIL.PAYMENT_DETAIL_SEQ_NUM = :PaymentDetailSeqNum
```

## Operations and processes
- [Payment detail and allocation](../operations/payment-detail-and-allocation.md)*

> **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.

## Business rules
- [BR-EFT-01: EFT authorization required for payment](../business-rules.md#br-eft-01-eft-authorization-gates-electronic-payment-eligibility)

## Sources
- `Business\SAIF.Business.Payment.EFT\clsPaymentDetail.vb`
