Search Results g_sqlerrm_token




Overview

The APPS.OKC_DELETE_CONTRACT_PVT package body is a private helper module within the Oracle E-Business Suite Contracts (OKC) schema, responsible for orchestrating the deletion of contract records and their dependent data. As an API classification of PVT (private), the package is not intended for direct external invocation; rather, it exposes functionality consumed by one or more public wrapper packages that enforce validation and security before cascading a physical delete. The package operates against core Contracts tables such as OKC_K_HEADERS_B, OKC_K_LINES_B, and OKC_ANCESTRYS, which together represent the header, line, and hierarchical relationship structures of a contract. By encapsulating delete logic in a private package, Oracle preserves data integrity and provides a single internal entry point for cleanup operations, while shielding application developers from the lower-level cascading dependencies that a contract removal entails.

Key Procedures and Functions

The documented metadata identifies a single public procedure, DELETE_CONTRACT. This procedure serves as the entry point for programmatic removal of a contract and its associated child records. Internally, the package also contains helper logic such as is_rule_allowed, which queries OKC_K_HEADERS_B to determine whether the contract's owning application (for example, application ID 515, corresponding to Oracle Service/OKS) permits the association of rules or rule groups. When the contract belongs to an application that prohibits rule assignment, the helper returns 'N'; otherwise it returns 'Y'. This check is significant because contract deletion must respect business rules governing whether rule and rule-group links exist and can be safely removed. Standard API conventions are observed throughout: l_api_version is initialized to 1, l_init_msg_list is set to 'T', and status is tracked through l_return_status initialized to OKC_API.G_RET_STS_SUCCESS, with message count and data captured in l_msg_count and l_msg_data respectively.

Tables Accessed

The package reads and writes across three primary Contracts tables. OKC_K_HEADERS_B stores contract header information and is queried to retrieve the owning application ID that drives rule-allowance logic. OKC_K_LINES_B holds the contract lines that must be removed alongside the header during deletion. OKC_ANCESTRYS maintains the ancestor-descendant hierarchy relationships that link contracts to their parent or child entities; these rows must be cleaned up to prevent orphaned hierarchy references. Together, these tables define the minimum set of objects that DELETE_CONTRACT must coordinate to achieve a consistent deletion without violating referential integrity or leaving dangling child data.

Usage Notes

Because OKC_DELETE_CONTRACT_PVT is a private package, it is invoked indirectly rather than called directly by customers or integrators. The metadata indicates it is referenced by exactly one other package, which is presumably the public API layer (such as OKC_DELETE_CONTRACT_PUB) that validates the calling context, performs authorization checks, and then delegates to this private implementation. Typical invocation paths include the Contracts forms-based user interface, concurrent programs that purge or archive contract data, and custom PL/SQL extensions that require bulk contract removal. The presence of the g_sqlcode_token search term suggests that troubleshooting delete failures often centers on Oracle error-token handling, so callers should always inspect x_return_status, x_msg_count, and x_msg_data after execution to surface the underlying SQL or business-rule failure. In EBS 12.1.1 and 12.2.2 the package remains a server-side plumbing component, meaning any direct references in custom code should be redirected to the public wrapper to remain patch-safe.