Search Results count_business_days




Overview

OKC_UTIL is a shared utility package in the Oracle Contracts (OKC) application family, declared with AUTHID CURRENT_USER so that it executes with the privileges of the calling schema. It is a foundational, cross-cutting component: the documented metadata lists 54 public procedures and functions and records that the package is referenced by 325 other packages. This breadth reflects its role as the common toolbox for the OKC modules — contract authoring, terms and conditions, access control, and multi-language display resolution. The package centralises logic that would otherwise be duplicated across the application, including dynamic SQL construction against JTF views, uniqueness and length validation helpers, business-day arithmetic, file and CLOB handling, lookup validation, and a lightweight tracing and logging framework built on UTL_FILE.

Key Procedures and Functions

The most frequently consulted members are the JTF lookup helpers. GET_NAME_FROM_JTFV, GET_DESC_FROM_JTFV, and GET_NAME_DESC_FROM_JTFV resolve a stored identifier into its translated name and/or description by querying a JTF view, which is the mechanism that supports multilingual display of contract entities. GET_SELECTNAME_FROM_JTFV and GET_SQL_FROM_JTFV build the dynamic SELECT statement or column list required to reach the correct underlying view, and are the routines most closely associated with the search term get_selectname_from_jtfv. Together these functions insulate calling code from the physical layout of the JTF view layer.

Validation and data-integrity helpers include CHECK_LENGTH, ADD_VIEW, CHECK_UNIQUE, CHECK_COMP_UNIQUE, and CHECK_LOOKUP_CODE, which respectively verify column lengths, register views used for length checking, enforce single- and composite-key uniqueness, and confirm that a value exists in FND_LOOKUP_VALUES. COUNT_BUSINESS_DAYS performs calendar arithmetic. The access-control group — GET_ALL_K_ACCESS_LEVEL, GET_K_ACCESS_LEVEL, and CREATE_K_ACCESS — works against the contract access tables. Utility routines CALL_USER_HOOK and FORMS_SAVEPOINT support extensibility and Forms transaction control. Text-handling members include COPY_CLOB, COPY_ARTICLES_TEXT, and COPY_ARTICLES_VARIED_TEXT, while GET_ORG_WINDOW_TITLE supports organisational display in the Forms UI.

Tables Accessed

The package touches FND_LANGUAGES to populate the global language-code table used for translation lookups, and FND_LOOKUP_VALUES for lookup validation. FND_PRODUCT_GROUPS supplies environment information. The JTF_OBJECTS_B and JTF_RS_* tables (JTF_RS_GROUPS_B, JTF_RS_GROUPS_DENORM, JTF_RS_GROUP_MEMBERS, JTF_RS_RESOURCE_EXTNS, JTF_RS_ROLES_B, JTF_RS_ROLE_RELATIONS) back the resource, group, and role resolution used by the JTF view helpers. Contract-specific data is read from OKC_ALLOWED_TMPL_USAGES and its _S sequence table, OKC_ARTICLE_VERSIONS, and OKC_K_ACCESSES. UTL_FILE is referenced for trace and output file operations.

Usage Notes

OKC_UTIL is invoked primarily from other PL/SQL packages, Oracle Forms triggers, and concurrent programs rather than being run directly by end users. Customisations should call the documented entry points rather than reimplementing their logic, since the JTF view-resolution routines encode the supported multilingual access path. Because it is AUTHID CURRENT_USER, callers must hold appropriate grants on the underlying tables. The global trace and log flags should be set only during diagnostics, as they open UTL_FILE handles on the database server.