Search Results retcode_error




Overview

OKC_TEMPLATE_KEYWORD_PVT is a private (PVT-classified) PL/SQL package body owned by APPS within the Oracle Contracts (OKC) module of Oracle E-Business Suite 12.1.1 and 12.2.2. Its business function is to maintain the Oracle Text (interMedia) search index named okc_terms_templates_ctx that backs keyword-based retrieval of contract terms and templates. Contract administrators and legal users rely on this index to locate templates and standard clauses by free-text keyword, so the package provides the controlled maintenance operations that keep that index synchronized, optimized, and usable from concurrent processing.

The package body is deliberately thin, exposing only administrative DDL-style operations against the Oracle Text index rather than transactional business logic. It is not intended to be called from contract entry forms during normal user transactions; its role is scheduled and DBA-driven upkeep of the search infrastructure.

Key Procedures and Functions

  • SYNC — Sets the effective schema to okc through ad_ctx_ddl.set_effective_schema and then invokes ad_ctx_ddl.sync_index on the okc_terms_templates_ctx index. This applies pending index changes so newly created or modified template keyword content becomes searchable. Any exception is propagated to the caller with a bare raise.
  • OPTIMIZE — Also sets the effective schema to okc, then calls ad_ctx_ddl.optimize_index with optlevel_full and maxtime_unlimited, performing a full optimization of the index to compact it and improve query performance. Exceptions propagate unchanged.
  • SYNC_CTX — The concurrent-program entry point for synchronization. It logs entry and exit via fnd_log.string using the package-level debug level, calls the internal sync procedure, and returns retcode_success ('0') on completion. Its exception handler sets retcode := retcode_error ('2') and truncates sqlerrm into the 200-character errbuf output parameter, which is the standard concurrent manager convention.
  • OPTIMIZE_CTX — The concurrent-program counterpart for optimization, invoking optimize and following the same errbuf/retcode error-reporting contract.

The named constants retcode_success ('0'), retcode_warning ('1'), and retcode_error ('2') define the standard Oracle EBS concurrent return codes. A search for "retcode_error" surfaces this package because that constant is assigned in the exception handler, which is the mechanism by which a failed index synchronization or optimization reports failure back to the concurrent manager rather than raising an unhandled error.

Tables Accessed

The only documented object referenced is the AD_CTX_DDL package, invoked through APPS synonyms. AD_CTX_DDL is the Oracle Application Object Library helper that wraps Oracle Text DDL operations (schema context, index synchronization, and optimization). The package therefore does not read or write contract tables directly; it manipulates the underlying okc_terms_templates_ctx index, whose source data resides in the OKC terms and templates tables maintained elsewhere in the Contracts schema.

Usage Notes

OKC_TEMPLATE_KEYWORD_PVT is classified as private, so it is not part of the supported public API surface. It is referenced by no other documented packages in ETRM 12.2.2. Typical invocation is through Oracle EBS concurrent programs that expose SYNC_CTX and OPTIMIZE_CTX, scheduled during low-activity windows because full index optimization is resource-intensive. The errbuf/retcode signature confirms the concurrent-manager pattern; administrators monitoring a request that ends with a return code of 2 should inspect the truncated SQL error text supplied by the exception handler.