Search Results delete_all_reservation




Overview

INV_CC_RESERVATIONS_PVT is a private (PVT) PL/SQL package in the Oracle EBS Inventory application, owned by the APPS schema. It forms part of the Inventory reservations API layer, which supports the creation, maintenance, and removal of material reservations against inventory on-hand quantities. A reservation ties a specific quantity of an item in a particular inventory organization, subinventory, and locator to a demanding source such as a sales order, a work order, or a transfer order line. This package provides callable interfaces that client code—including Oracle Forms and other PL/SQL packages—can use to manipulate reservation data through a controlled API surface rather than through direct table DML.

The package is declared with AUTHID CURRENT_USER, meaning its SQL executes with the privileges of the invoking user rather than the definer. The source header (INVDRSVS.pls version 120.1) identifies it as an original Inventory code unit maintained by Oracle development. Its API classification as PVT indicates it is intended for internal consumption within the Inventory product family; Oracle does not publish it as a supported public interface, and direct external dependency is discouraged because signatures may change without notice across releases such as 12.1.1 and 12.2.2.

Key Procedures and Functions

The ETRM documentation records two callable units within this package:

  • DEFINE_RESERV_REC_TYPE — A function that returns the reservation record type structure used by the client. It returns INV_RESERVATION_GLOBAL.MTL_RESERVATION_REC_TYPE, the global PL/SQL record definition that carries the reservation attributes (such as inventory item, organization, subinventory, locator, and reserved quantity) between the caller and the API. By exposing this function, the package allows callers to declare a locally typed variable that is guaranteed to match the record structure expected by the API procedures, without hard-coding the structure.
  • DELETE_ALL_RESERVATION — A procedure that removes all reservation records associated with the reservation identified in the passed record. It accepts a reservation record of type MTL_RESERVATION_REC_TYPE along with standard API parameters (API version, message-list initialization flag), and returns the conventional API out parameters: a numeric error code, return status, message count, and message data. The NOCOPY hint on the out parameters, added to comply with the GSCC File.Sql.39 standard (Bug 4410902), improves performance by passing those values by reference. The x_return_status value follows the FND_API convention (success, expected error, or unexpected error), and callers are expected to inspect it and, where applicable, retrieve the buffered messages via the message count and message data parameters.

Tables Accessed

The ETRM extract for this package does not enumerate underlying tables directly; access is made through APPS synonyms. Functionally, the reservation record structure passed to DELETE_ALL_RESERVATION corresponds to the MTL_RESERVATIONS entity, the base table that stores reservation demand rows against inventory. The delete operation removes those rows rather than merely flagging them, so the effect is a physical deletion of the reservation records for the specified reservation context. Because the record type is defined in INV_RESERVATION_GLOBAL, the same structure is shared by the broader reservation API family, ensuring consistent interpretation of the reservation key fields across create, update, and delete operations.

Usage Notes

INV_CC_RESERVATIONS_PVT is referenced by two other packages within the Inventory reservation call stack, reflecting its role as an internal worker routine invoked by higher-level reservation APIs rather than called directly by end users. Invocation typically occurs in the following scenarios:

  • From user interface forms or concurrent programs that need to purge all reservation rows for a given reservation reference, for example during order cancellation, line deletion, or inventory cleanup processing.
  • From other PL/SQL packages in the reservation API hierarchy that delegate mass deletion of reservations to this routine.
  • From custom code, cautiously, by first calling DEFINE_RESERV_REC_TYPE to obtain the correct record structure, populating the record fields, then calling DELETE_ALL_RESERVATION and validating x_return_status before proceeding.

Because the package is classified PVT, customizations should treat it as version-sensitive and should prefer public APIs where an equivalent capability exists. Standard API error handling practice applies: check the return status immediately after each call, and when it is not success, read x_msg_count and x_msg_data (or query the FND message stack) to obtain the error detail.