Search Results write_to_file




Overview

BIS_DIMLEVEL_ERRS_PVT is a private PL/SQL package in the APPS schema that supports the Oracle Business Intelligence System (BIS) dimensional data extraction infrastructure within Oracle E-Business Suite. Its documented purpose, drawn from the embedded header comment, is to serve as a "Private API for getting the Select String for DimensionLevelValues," retrieving the appropriate select string from either the EDW or BIS source depending on the value of the profile option BIS_SOURCE. Alongside this retrieval responsibility, the package provides a diagnostic and error-reporting layer used by the BIS dimensional extraction programs, allowing runtime errors encountered during fact and dimension processing to be written to a flat file on the database server and surfaced to the caller. As a member of the PVT (private) API classification, it is not intended for direct invocation by end users or external integrations; it is consumed internally by the BIS/EDW packages, most notably the dimensional level retrieval routines.

Key Procedures and Functions

The ETRM metadata documents three procedures for this package body:

  • FILE_OPEN — Opens a server-side flat file for output using UTL_FILE. It resolves the target directory from the database initialization parameter utl_file_dir, handles the case where multiple directory entries are supplied by taking the first, defaults the file name to the EDW_ERRORS constant when no name is passed, closes any already-open handle, and raises application errors for invalid path or invalid mode conditions.
  • WRITE_TO_FILE — Writes error or diagnostic text to the file handle previously returned by FILE_OPEN. This procedure corresponds to the "write_to_file" term for which this object is frequently searched, and it is the routine responsible for persisting the dimensional-level error records produced during BIS extraction runs.
  • REPORT_ERRORS — Formats and reports the accumulated dimensional-level errors, typically by iterating the collected error information and emitting it through WRITE_TO_FILE and/or raising it back to the invoking program so that the concurrent request log reflects the failure.

The package also declares constants referencing the EDW account flexfield (EDW_GL), level table suffix (_LTC), level flex primary key suffix (_NAME), and the package name constant. Notably, the header comment identifies G_PKG_NAME as BIS_PMF_GET_DIMLEVELS_PVT, indicating shared lineage with the dimensional level retrieval package.

Tables Accessed

  • UTL_FILE — The Oracle-supplied PL/SQL file I/O package. BIS_DIMLEVEL_ERRS_PVT calls UTL_FILE.FOPEN, UTL_FILE.IS_OPEN, UTL_FILE.FCLOSE, and related routines to create and manage the error output file on the database server.
  • V$PARAMETER — Queried through the cursor c_file to read the value of the utl_file_dir initialization parameter, which supplies the permitted directory into which the error file is written.

No application tables are directly referenced by this package; its persistence mechanism is the operating-system file rather than the database, consistent with its role as a lightweight error-capture utility.

Usage Notes

This package is invoked internally by the BIS dimensional extraction and level processing programs during concurrent program execution, particularly when dimensional level values must be resolved from either the EDW or BIS source as governed by the BIS_SOURCE profile option. When an error occurs during a dimensional load, the calling program opens the error file through FILE_OPEN, records each failure message through WRITE_TO_FILE, and finalizes reporting through REPORT_ERRORS so the concurrent manager request log and the output file both reflect the condition. Because the package is classified PVT and is referenced by no other packaged APIs in the documented metadata, it should be treated as an implementation detail: customizations should not call it directly, but rather invoke the public BIS dimensional APIs, which in turn drive this error-handling layer. Administrators should ensure utl_file_dir is configured and that the APPS database user possesses the required UTL_FILE privileges, otherwise FILE_OPEN will raise the invalid path condition described above.