Search Results set_filehandle




Overview

XTR_DEBUG_PKG is a diagnostic and tracing utility package owned by the APPS schema in Oracle E-Business Suite releases 12.1.1 and 12.2.2. It is classified under the ETRM "OTHER" API category, indicating that it is not an application-facing business API but rather an internal infrastructure component used by other EBS code modules during development, testing, and production troubleshooting. The package is defined with AUTHID CURRENT_USER, meaning its unqualified references resolve against the privileges and schema of the calling session rather than the definer, which allows invoking code to control file access through its own directory and file privileges.

The package supplies a lightweight file-based logging facility built on the Oracle-supplied UTL_FILE PL/SQL package. Its principal purpose is to allow developers and support engineers to route diagnostic messages generated by EBS code to an operating-system file for later inspection, and to disable that routing when diagnostics are no longer required. It is referenced by 17 other packages in the EBS codebase, which confirms its role as a shared tracing service rather than a standalone tool.

Key Procedures and Functions

The package exposes five documented program units:

  • ENABLE_FILE_DEBUG (overloaded, path and file form) — An overloaded procedure accepting a path name and a file name. It activates file-based debugging for the session by opening or creating the nominated output file in the nominated directory, so that subsequent DEBUG calls are written to that file.
  • ENABLE_FILE_DEBUG (no-argument form) — The second overload, invoked without parameters, enables file debugging using whatever default or previously established file handle configuration is in effect. Callers use this variant when the output destination has already been determined.
  • DISABLE_FILE_DEBUG — Terminates file-based debugging for the session and closes the associated file handle, ceasing further log output.
  • DEBUG — Accepts a line of text and emits it to the currently enabled debugging destination. When file debugging has been enabled, the line is written through the package's file handle; when debugging is inactive, the call is effectively a no-op.
  • SET_FILEHANDLE — Assigns or overrides the UTL_FILE file handle used for output, taking a UTL_FILE.FILE_TYPE value that defaults to NULL. This allows a caller that has opened its own file to redirect the package's diagnostic output to that handle.

The package specification additionally declares a package-level variable, PG_SQLPLUS_ENABLE_FLAG, which supports diagnostic behavior in SQL*Plus sessions.

Tables Accessed

XTR_DEBUG_PKG does not read or write any application database tables. The only documented object it interacts with is UTL_FILE, accessed through an APPS synonym. UTL_FILE is not a table but the Oracle-supplied PL/SQL package providing server-side operating-system file input and output. All "data" handled by XTR_DEBUG_PKG is therefore diagnostic text written to flat files, not rows persisted in the EBS schema. This design keeps the tracing mechanism free of any transactional impact on application data.

Usage Notes

The package is typically invoked from other PL/SQL packages, concurrent program logic, or custom code rather than from an Oracle Forms user interface. A developer or support analyst first calls ENABLE_FILE_DEBUG, supplying a valid directory path and file name, then places DEBUG calls at points of interest in the surrounding code. The resulting file can be reviewed to reconstruct execution flow and variable values. When tracing is complete, DISABLE_FILE_DEBUG releases the file handle.

Because the package is AUTHID CURRENT_USER, the calling schema must hold the necessary UTL_FILE privileges and the database or application server directory must be valid and accessible to that session. In a multi-tier EBS 12.1.1 or 12.2.2 deployment, the file is created on the host where the PL/SQL executes, so path selection must account for the database server file system. Given that 17 packages already reference this utility, its behavior can be activated indirectly by enabling debugging in those dependent modules.