Search Results get_last_sql
Overview
APPS.GL_JOURNAL_IMPORT_PKG is a server-side PL/SQL package body within the Oracle E-Business Suite General Ledger module. Its principal business function is to support the Journal Import process, the mechanism by which unposted journal entry data staged in the GL_INTERFACE table is validated, transformed, and transferred into the GL_JE_BATCHES, GL_JE_HEADERS, and GL_JE_LINES tables. The package operates in the technical domain that surrounds Journal Import rather than the core import engine itself; it manages the interface control records that track each import run and provides diagnostic utilities used during import processing and troubleshooting. It is classified as an OTHER API and is not a formally published public API, indicating that it is intended principally for internal use by Oracle's own Journal Import infrastructure and by carefully controlled extensions.
Key Procedures and Functions
The package body exposes five documented program units, each serving a specific supporting role in the import cycle:
- CREATE_TABLE — Creates a temporary or supporting table used during import processing. It relies on the AD_DDL synonym, indicating it executes dynamic DDL statements as part of its operation.
- DROP_TABLE — The counterpart to CREATE_TABLE, removing the temporary object once import processing is complete. Together these two procedures implement a create/use/drop lifecycle for scratch storage during Journal Import.
- POPULATE_INTERFACE_CONTROL — Populates or maintains the GL_INTERFACE_CONTROL record for an import run. This is the central control mechanism that records group identifiers, statuses, and processing statistics for each Journal Import execution.
- GET_LAST_SQL — Returns the most recently executed SQL statement, providing diagnostic visibility into the dynamic SQL statements the package generated and ran. This is valuable for debugging failed or partially completed imports.
- GET_ERROR_MSG — Retrieves the error message associated with a failed operation, supporting error reporting and exception handling during Journal Import.
Tables Accessed
The package references several tables through APPS synonyms, each with a defined purpose:
- GL_INTERFACE_CONTROL — The primary control table holding status and group-level information for each Journal Import run. The package reads and writes this table to track and update import progress.
- GL_INTERFACE_CONTROL_S — The sequence associated with GL_INTERFACE_CONTROL, used to generate unique control identifiers. This is the object most directly associated with the user's search term "gl_interface_control_s."
- GL_JE_SOURCES — The journal source definition table, consulted to validate and interpret the source of the journal entries being imported.
- GL_JOURNAL_IMPORT_S — The sequence supplying identifiers for Journal Import processing.
- FND_ORACLE_USERID — The Oracle Applications user identifier table, used to establish the database user context during processing.
- AD_DDL and DUAL — Utility objects used respectively for executing dynamic DDL and for single-row queries.
Usage Notes
GL_JOURNAL_IMPORT_PKG is invoked indirectly during the Journal Import concurrent program rather than through a standard Oracle Forms interface. Its procedures are called by Oracle's own Journal Import infrastructure, and the package is referenced by four other database objects. Because it is classified as an OTHER API and manipulates interface control data and dynamic DDL, custom code should invoke it only with caution and only after thorough testing in a non-production environment. The GET_LAST_SQL and GET_ERROR_MSG functions are particularly useful for technical troubleshooting when a Journal Import run terminates with unexpected errors, as they expose the last dynamic statement executed and the associated error text. The package is VALID and available in both EBS 12.1.1 and 12.2.2 environments.