Search Results last_message_sequence




Overview

AS_MESSAGE is an Oracle E-Business Suite PL/SQL package owned by the APPS schema that provides a centralized message-handling facility for concurrent programs and server-side processes. Its principal business function is to govern how output and diagnostic messages generated during program execution are captured, buffered, and made available for review. The package supports two distinct storage strategies: messages may be written to the database table AS_CONC_REQUEST_MESSAGES, or they may be accumulated in an in-memory message stack. This dual-mode design allows developers to choose persistence when a durable audit trail is required, and lightweight in-memory buffering when performance or transient processing is the priority. The package also exposes an abort exception that signals a server program to terminate processing and return control to the calling client. In the Oracle EBS 12.1.1 and 12.2.2 releases, AS_MESSAGE belongs to the Application Server technology stack layer and is classified as an OTHER API, indicating it is a general-purpose utility rather than a business-object API.

Key Procedures and Functions

The package declares fourteen documented routines. The following are the most significant:

  • INITIALIZE — Must be the first call to the package. It configures the output destination (either the AS_CONC_REQUEST_MESSAGES table or the in-memory stack), sets the concurrent request identifier, and optionally enables debug mode with a separate debug output destination. If omitted, output defaults to the stack and the request identifier defaults to zero.
  • SET_LINE / PUT_LINE — Write a non-translated message to the output buffer. Both routines perform the same function; PUT_LINE is the older form and is slated for eventual removal.
  • FLUSH — Emits buffered messages to their configured destination.
  • DEBUG — Writes diagnostic output when debug mode is enabled.
  • SET_NAME / SET_TOKEN — Establish naming and token substitution context for message text.
  • GET — Retrieves a message from the buffer.
  • SET_ERROR — Records an error condition for subsequent reporting.
  • PUT_DB_ERROR — Captures and writes a database error to the output buffer.
  • CLEAR — Empties the message buffer.
  • MESSAGE_COUNT — Returns the number of messages currently held.
  • PURGE_MESSAGES — Removes stored messages, typically for the associated concurrent request.
  • LAST_MESSAGE_SEQUENCE — Returns the sequence value of the most recently written message, enabling callers to track or reference message ordering. This function is the object of the user's search.

Tables Accessed

AS_MESSAGE references two tables through APPS synonyms: AS_CONC_REQUEST_MESSAGES and AS_CONC_REQUEST_MESSAGES_S. The first is the primary staging table into which messages are inserted when the output code is initialized as TABLE. The second, the _S variant, is the corresponding sequence or secondary table used to generate and track message sequence identifiers. The LAST_MESSAGE_SEQUENCE function derives its return value from this sequencing mechanism, allowing callers to obtain the identifier of the latest message written during a request's execution.

Usage Notes

AS_MESSAGE is typically invoked from PL/SQL-based concurrent programs, server-side utilities, and custom code that must report progress, emit diagnostics, or record errors against a concurrent request. A caller normally issues INITIALIZE first, writes output through PUT_LINE or SET_LINE, optionally emits DB errors via PUT_DB_ERROR, and concludes with FLUSH to persist buffered content. Although the package is documented as being referenced by zero other packages, it remains available for direct invocation by application code and concurrent program logic. Developers should note the dependency on correct initialization ordering and should use LAST_MESSAGE_SEQUENCE when message ordering must be tracked programmatically.