Search Results okl_sqlcode




Overview

OKL_FORMULAVALIDATE_PUB is a public API package in the Oracle E-Business Suite (EBS) Lease and Finance Management (OKL) module, owned by the APPS schema. Its business purpose is to validate the formulas associated with lease and financing contracts before those formulas are committed to the database. Lease formulas drive critical calculations such as payment schedules, interest accrual, residuals, and termination values, so ensuring that a formula definition is structurally and semantically valid is a prerequisite to reliable contract processing. The package follows the standard EBS PL/SQL API design conventions, declaring itself with AUTHID CURRENT_USER and exposing global constants and exception handles consistent with the OKL API infrastructure. Notably, the metadata context references the token OKL_SQLCODE (defined as G_SQLCODE_TOKEN CONSTANT VARCHAR2(200) := 'OKL_SQLCODE';), which is used together with OKL_SQLERRM to surface the underlying Oracle SQL error code and message through the standard OKC/OKL message-handling framework. An exception handle, G_EXCEPTION_HALT_PROCESSING, is also declared to allow graceful termination of validation when a fatal condition is encountered.

Key Procedures and Functions

The package exposes a single documented public procedure:

  • VAL_ValidateFormula — The core validation entry point. It accepts an API version identifier, an initialization flag (p_init_msg_list) defaulting to OKC_API.G_FALSE, standard output parameters for return status, message count, and message data, a validation status output parameter, and inbound identifiers for the formula (p_fma_id) and its governing context group (p_cgr_id). The procedure evaluates whether the specified formula and its associated context group are valid for use, returning a validation status and any diagnostic messages through the output parameters. Because the identifiers are typed against okl_formulae_v.id%TYPE and okl_context_groups_v.id%TYPE, the API is anchored directly to the OKL data model, ensuring that only legitimate formula and context group records are passed for evaluation.

Tables Accessed

The package operates against the core OKL formula configuration tables, referenced through APPS synonyms. The primary table is okl_formulae_v, which stores formula header definitions, and okl_context_groups_v, which stores the context groups that scope how formulas are evaluated. The procedure reads these tables to confirm the supplied p_fma_id and p_cgr_id identify a valid, enabled formula and context group combination before returning a validation verdict. The metadata does not indicate direct writes to these tables; the API is principally a read-and-validate operation. The _v suffix denotes the EBS version-enabled (or view) objects used to support multi-version/audit tracking in the OKL schema.

Usage Notes

OKL_FORMULAVALIDATE_PUB is a public API and is typically invoked from within the Lease Management setup and contract entry flows, such as user interface components (Oracle Forms / OAF pages) and supporting concurrent programs where formula definitions are defined or verified. Custom extensions and integrations that create or modify lease formulas should call VAL_ValidateFormula prior to persisting changes, honoring the standard EBS API contract: use p_init_msg_list = OKC_API.G_FALSE when the message stack should be preserved, and always inspect x_return_status and x_msg_data (or the message stack via OKC_API.GET_MESSAGE) before proceeding. No other packages in the documented set reference this package, so callers are expected to be user interfaces, concurrent programs, or custom code rather than other OKL APIs. Because the package was last updated in the 11i era (header revision 115.2), it remains available and compatible across Oracle EBS 12.1.1 and 12.2.2 releases, where the underlying OKL schema and API conventions were preserved.