Search Results write_raw
Overview
FND_LOG_ATTACHMENT is a low-level Oracle E-Business Suite utility package that intermediates between the FND_LOG logging infrastructure and the FND_LOG_REPOSITORY attachment store. Its principal business function is to capture message payloads produced by concurrent programs, PL/SQL APIs, and diagnostic routines, buffer them in a PL/SQL associative array keyed by attachment identifier, and subsequently persist them as BLOB content associated with a log message. In this way, arbitrarily large diagnostic text — which would otherwise exceed the limits of a single log line — can be recorded against an attachment identifier and retrieved on demand from the logging repository.
The package internally declares an AttachmentsCache type as a table of LONG RAW indexed by BINARY_INTEGER, exposed through the private variable mCache. Buffer accumulation and flush operations are performed against this structure. The FLUSH procedure is declared with pragma AUTONOMOUS_TRANSACTION, ensuring that attachment writes are committed independently and do not interfere with the transaction context of the calling program.
Key Procedures and Functions
- WRITE — Appends a message fragment to the buffer associated with a supplied attachment identifier. It is the primary entry point for accumulating character-based content prior to persistence.
- WRITELN — Performs the same buffering operation as WRITE while appending a line-terminator, so that multi-line diagnostic output is preserved correctly when the attachment is later rendered.
- WRITE_RAW — Buffers binary payloads, accepting LONG RAW input rather than character data, and applies the same cache-existence and size-threshold logic used by the character-based routines.
- WRITE_INTERNAL — The shared internal implementation routine that all public write variants funnel through. It handles cache lookup, size accumulation, threshold evaluation, and delegation to the flush logic.
- CLOSE — Terminates the attachment lifecycle by flushing any remaining buffered content and releasing the corresponding cache entry.
The underlying buffer logic checks whether the target attachment identifier already exists in the cache, concatenates the incoming payload using UTL_RAW.CONCAT, and — when the accumulated length reaches approximately 10,000 bytes — invokes FLUSH before restarting the buffer. FLUSH retrieves the target BLOB via FND_LOG_REPOSITORY.GET_BLOB_INTERNAL and appends the buffered LONG RAW using DBMS_LOB.WRITEAPPEND, followed by a commit. When statement-level logging is active, a diagnostic string recording the log sequence and message length is emitted through FND_LOG.STRING.
Tables Accessed
The package does not manipulate application tables directly. Its documented dependencies are on PL/SQL-supplied packages referenced through APPS synonyms: DBMS_LOB for BLOB append operations, UTL_RAW for raw conversion, length, and concatenation primitives, and PLITBLM as the underlying support package used by DBMS_LOB. Persistence of attachment content is delegated to FND_LOG_REPOSITORY, which owns the FND_LOGS and FND_LOG_ATTACHMENTS data. Consequently, all durable writes occur through the repository API rather than through direct DML against logging tables.
Usage Notes
FND_LOG_ATTACHMENT is not intended for direct invocation by end users. It is referenced by six other packages within the EBS codebase and is invoked indirectly whenever the logging framework needs to associate large payloads — SQL trace output, PL/SQL debug dumps, or XML diagnostics — with a log entry. Typical invocation scenarios include concurrent program debugging, forms-level diagnostics, and custom code that calls FND_LOG APIs with attachment identifiers. The same source (AFUTLGTB.pls, version 115.3) is shipped in both 12.1.1 and 12.2.2, so behaviour is consistent across the two releases. Developers extending logging should treat this package as an internal implementation detail and route attachment requests through the documented FND_LOG and FND_LOG_REPOSITORY interfaces.
-
PACKAGE BODY: APPS.FND_LOG_ATTACHMENT
12.1.1
-
PACKAGE: APPS.FND_LOG_ATTACHMENT
12.2.2
-
PACKAGE BODY: APPS.FND_LOG_ATTACHMENT
12.2.2
-
PACKAGE: APPS.FND_LOG_ATTACHMENT
12.1.1
-
PACKAGE: APPS.OKS_MAIL
12.2.2
-
PACKAGE: APPS.OKS_MAIL
12.1.1
-
PACKAGE: APPS.FND_LOG
12.2.2
-
PACKAGE: APPS.FND_LOG
12.1.1
-
PACKAGE BODY: APPS.OKS_MAIL
12.2.2
-
PACKAGE BODY: APPS.FND_LOG
12.1.1
-
PACKAGE BODY: APPS.OKS_MAIL
12.1.1
-
PACKAGE: SYS.UTL_HTTP
12.1.1
-
PACKAGE: SYS.UTL_HTTP
12.2.2
-
PACKAGE BODY: APPS.FND_LOG
12.2.2
-
PACKAGE: SYS.UTL_TCP
12.2.2
-
PACKAGE: SYS.UTL_TCP
12.1.1
-
APPS.OKS_MAIL dependencies on UTL_SMTP
12.2.2
-
APPS.OKS_MAIL dependencies on UTL_SMTP
12.1.1
-
APPS.FND_LOG dependencies on FND_LOG
12.1.1
-
APPS.FND_LOG dependencies on FND_LOG
12.2.2
-
APPS.OKS_MAIL dependencies on UTL_SMTP
12.2.2
-
APPS.OKS_MAIL dependencies on UTL_SMTP
12.1.1
-
APPS.OKS_MAIL dependencies on FND_FILE
12.1.1
-
APPS.OKS_MAIL dependencies on FND_FILE
12.2.2