Search Results okl_contracts_unexpected_error




Overview

OKL_AMORT_SCHED_REQ_PVT is a private (PVT) PL/SQL package in the Oracle E-Business Suite Oracle Lease and Finance Management (OKL) module. It supports the amortization schedule request processing flow, which governs how lease and loan contract amortization schedules are generated, submitted, or refreshed when contract financial terms change. The package is declared with AUTHID CURRENT_USER, so its SQL executes under the privileges of the calling user rather than the package owner. This is consistent with the ETRM convention that internal private APIs are invoked from public API wrappers running in the caller's security context.

The package header includes standard error-handling constants. G_UNEXPECTED_ERROR is set to the literal 'OKL_CONTRACTS_UNEXPECTED_ERROR', the same token that appears in the user's search "okl_contracts_unexpected_error". This token is the generic message raised when the package's exception handlers trap an unhandled Oracle error or a business-rule failure. Because the token string is defined here and in the OKL_API package, the appearance of OKL_CONTRACTS_UNEXPECTED_ERROR in a form or concurrent program log frequently correlates with a failure inside OKL_AMORT_SCHED_REQ_PVT.PROCESS_TRX_REQUEST. The package is classified as a private API and is referenced by no other documented package, indicating it is called from within the OKL module's own code base rather than exposed for external integration.

Key Procedures and Functions

  • PROCESS_TRX_REQUEST — The single documented procedure in the package. It processes a transaction request for the amortization schedule associated with a contract. Its parameters include the contract header identifier (p_chr_id, typed against okc_k_headers_b.id) and the API version (p_api_version), following the standard ETRM API signature pattern. It supports the usual p_init_msg_list, p_comments, and p_user_id arguments, and returns the standard x_return_status, x_msg_count, and x_msg_data outputs. It additionally returns x_trx_req_id, typed against okl_trx_requests.id, and a Boolean x_summ_flag. The procedure's role is to create or drive the transaction request record that triggers amortization schedule processing for the contract.

Tables Accessed

  • OKC_K_HEADERS_B — The contract headers base table. The procedure receives the contract header primary key as input, and reads header information needed to initiate amortization schedule processing for the contract.
  • OKL_TRX_REQUESTS — The transaction requests table. The procedure returns or populates a transaction request identifier from this table, and the request record drives downstream processing of the amortization schedule request.

Usage Notes

As a PVT package, OKL_AMORT_SCHED_REQ_PVT is not intended for direct invocation by external or customer code. It is normally called from the public OKL API layer, from Oracle Forms events in the Lease Management forms (for example, when a user saves a contract or changes amortization-relevant terms), or from concurrent program logic that processes transaction requests in batch. Because the package declares G_UNEXPECTED_ERROR as 'OKL_CONTRACTS_UNEXPECTED_ERROR', any unhandled exception during PROCESS_TRX_REQUEST is typically surfaced to the caller under that message token.

When diagnosing the error "okl_contracts_unexpected_error", the underlying cause is usually in the database objects or business rules this procedure touches, such as invalid contract header data, missing amortization parameters, or constraint violations on OKL_TRX_REQUESTS. The generic token masks the specific Oracle error, so the SQLERRM and SQLCODE tokens (G_SQLERRM_TOKEN and G_SQLCODE_TOKEN) are used by the surrounding API to capture the real underlying message. Oracle does not document a public interface for this package, and it should not be modified or called directly; defects or unexpected errors should be traced through the invoking public API or form using the SQLCODE and SQLERRM values captured at the time of failure.