Search Results count_messages




Overview

APPS.PER_ACCRUAL_MESSAGE_PKG is a server-side PL/SQL package body in Oracle E-Business Suite (12.1.1 and 12.2.2) that belongs to the Oracle Human Resources (PER) accrual processing area. Its role is to provide a lightweight, package-scoped message repository used during accrual-related processing. Rather than writing messages directly to a database table or raising exceptions immediately, the package accumulates textual messages in an in-memory PL/SQL collection, allowing a calling program to build up a diagnostic or status log and read it back in a controlled sequence.

The package declares a package global collection type, global_message_t, defined as TABLE OF varchar2(256) INDEX BY BINARY_INTEGER, and a package-level instance named global_message. Because this collection is declared at package level, its contents persist for the duration of the database session (or the lifetime of the package state), making the package a session-scoped message buffer rather than a persistent store. The source header indicates the object has been part of the HR product since the 11.5 code line, consistent with its designation as an OTHER API classification.

Key Procedures and Functions

  • PUT_MESSAGE — Appends a supplied message string to the package global message table. It computes the next available index from the current count of the collection and stores the message at that position. It returns a numeric status value, returning 0 on success. This is the entry point referenced by users searching for "put_message."
  • GET_MESSAGE — Retrieves a message from the table by its table position. It returns the stored message string corresponding to the supplied position, enabling callers to walk the accumulated messages in order.
  • CLEAR_TABLE — Removes all messages from the message table, resetting the buffer so a new processing cycle can begin with an empty collection.
  • COUNT_MESSAGES — Returns the number of messages currently held in the table, allowing callers to determine how many entries exist before iterating with GET_MESSAGE.

All four procedures and functions follow the standard HR utility convention of invoking hr_utility.set_location for instrumentation, and each establishes its own local procedure-name variable prefixed by the global package name for error-tracing purposes.

Tables Accessed

The only table referenced through APPS synonyms is PLITBLM (the PL/SQL interleaved table base table). Access to this table is a characteristic artifact of packages that declare and manipulate PL/SQL index-by tables, particularly when they are used across package boundaries or interpreted by the PL/SQL engine. The package does not persist its messages to any application data table; the message values live solely in the package global collection, and PLITBLM supports the underlying collection mechanism rather than serving as a business message store.

Usage Notes

PER_ACCRUAL_MESSAGE_PKG is documented as being referenced by four other packages, indicating it functions as a shared utility embedded within the accrual processing call stack rather than as a standalone or user-invoked API. It is typically invoked from PL/SQL code — accrual calculation routines, concurrent program logic, or other HR packages — where a caller wishes to accumulate descriptive messages during processing and subsequently read them back for logging, display, or error reporting. Custom code may call PUT_MESSAGE to register diagnostic text, COUNT_MESSAGES and GET_MESSAGE to iterate and consume the buffer, and CLEAR_TABLE to reset state before a new run. Because the buffer is session-scoped and non-persistent, messages are lost when the session ends, and the package is not intended for durable message storage or for direct invocation from Oracle Forms user interfaces.