Search Results okc_contracts_unexpected_error




Overview

OKL_AM_TERMNT_INTERFACE_PUB is a public PL/SQL package in the Oracle E-Business Suite Applications (APPS) schema that supports the Oracle Lease and Finance Management (OKL / ETRM) product family. Its declared purpose, reflected in its name and package header, is to serve as the public programmatic entry point for the termination interface process — the mechanism through which lease or contract termination events are passed from external or upstream sources into the ETRM termination-processing tables. The package is compiled with AUTHID CURRENT_USER, meaning that its unqualified database references resolve under the privileges of the invoking schema rather than the package owner.

The header declares two global constants that are significant for diagnostics. G_APP_NAME is initialized from OKL_API.G_APP_NAME, tying the package to the standard ETRM API framework. G_UNEXPECTED_ERROR is initialized to the literal string 'OKC_CONTRACTS_UNEXPECTED_ERROR'. This constant is the message token surfaced by Oracle Forms and the EBS error-handling stack whenever an unhandled exception is trapped during package execution. It is the direct origin of the widely reported Forms error that users encounter as "okc_contracts_unexpected_error." Two further constants, G_SQLERRM_TOKEN and G_SQLCODE_TOKEN, are defined so that the original SQLERRM and SQLCODE values can be embedded into the formatted error message, preserving the underlying database error text for support analysis.

Key Procedures and Functions

The package exposes a single documented public procedure, TERMINATION_INTERFACE. It is defined with two OUT NOCOPY parameters: an error buffer that returns any diagnostic message text, and a return code that returns the numeric status of the call. NOCOPY is used to avoid copying large VARCHAR2 buffers on return. As the only public entry point, TERMINATION_INTERFACE encapsulates the loading and validation logic for termination records, raising and formatting an exception through the standard ETRM error-handling pattern when processing fails. No other procedures or functions are documented in the package specification.

Tables Accessed

The ETRM metadata for this object does not enumerate any tables referenced through APPS synonyms. This is consistent with a public wrapper package whose specification defines only the interface contract; the substantive DML against the termination interface and lease/contract tables is performed by the corresponding private implementation package body and by the OKL and OKC base tables that receive the terminated contract data. Because the specification alone carries no table references, dependency analysis of this package should be performed against its body and against the objects that invoke it rather than against the header.

Usage Notes

TERMINATION_INTERFACE is typically invoked from the ETRM Forms-based termination user interface and from concurrent or batch programs that submit termination batches for processing, and it may be called directly from custom PL/SQL that needs to drive the same termination interface path. The package is documented in ETRM 12.2.2 and the header carries a 2003 copyright/version stamp, indicating a long-standing component that has remained stable across releases including 12.1.1 and 12.2.2.

  • Standard invocation pattern: call the procedure, then inspect the return code and error buffer before committing.
  • When the call fails, the returned message commonly resolves to OKC_CONTRACTS_UNEXPECTED_ERROR, and the SQLerrm and SQLcode tokens appended to the message carry the true database cause.
  • Because the package is classified PUB and owned by APPS, it should be called with APPS initialization (FND_GLOBAL.APPS_INITIALIZE) already performed so that MOAC and security context are correct.
  • Referenced by zero other packages per the documented metadata, so it is an entry point rather than a shared utility — custom code should not depend on undocumented internals.