Search Results fnd_dsql




Overview

FND_DSQL is a utility package body owned by the APPS schema in Oracle E-Business Suite 12.1.1 and 12.2.2. Its name reflects its purpose: it provides a Dynamic SQL wrapper built on top of the PL/SQL-supplied DBMS_SQL package. Rather than forcing every internal Oracle EBS module to construct, parse, bind, execute, and fetch dynamic cursors by hand, FND_DSQL encapsulates that lifecycle into a small, repeatable API. This makes it an infrastructure component of the E-Business Suite, not a business-facing module. It has no application data responsibilities and does not touch any Oracle EBS product tables; instead, it operates purely on the SQL text and bind values passed to it in memory. Because it is documented as VALID and classified under API type OTHER, it is treated as an internal helper rather than a published extension point, but it remains widely consumed across the technology stack.

Key Procedures and Functions

The ETRM metadata documents nine procedures and functions for this package. Names and purposes are as follows:

  • INIT — Initializes internal package or cursor state prior to building a dynamic statement. This establishes the working context for subsequent calls.
  • ADD_TEXT — Appends a fragment of SQL text to the statement under construction, allowing callers to assemble statements piece by piece rather than as a single string.
  • ADD_BIND — Registers a bind variable and its value against the statement, supporting safe parameterization and helping avoid literal concatenation of untrusted values.
  • SET_CURSOR — Associates the assembled text and binds with a cursor, finalizing the statement definition so it can be parsed and opened.
  • DO_BINDS — Performs the actual binding of previously registered values to the cursor, executing the bind step of the DBMS_SQL cycle.
  • GET_TEXT — Retrieves the assembled SQL text, useful for logging, diagnostics, or verification of the statement that will be executed.
  • FND_DSQL_TEST — A self-test or diagnostic routine used to validate that the package functions correctly within a given environment.

The metadata lists nine entries but names seven; the remaining two are not enumerated in the excerpt. No parameter lists are documented and none should be assumed.

Tables Accessed

No Oracle EBS application tables are referenced. The documented dependencies of FND_DSQL are limited to the package itself (FND_DSQL), FND_GLOBAL, FND_MESSAGE, the PL/SQL-supplied DBMS_SQL package, PLITBLM, and SYS-owned STANDARD. FND_GLOBAL is used for session context such as application, responsibility, and user identifiers. FND_MESSAGE is used for message retrieval, likely during error handling. DBMS_SQL and PLITBLM constitute the runtime engine that FND_DSQL wraps. Because the package maintains no persistent state in application tables, it is stateless from a data perspective and safe for concurrent use across sessions.

Usage Notes

FND_DSQL is typically invoked indirectly. The ETRM record states that it is referenced by 23 other packages, while referencing none itself. This fan-in pattern confirms its role as a shared internal service used throughout the E-Business Suite technology stack. It is generally not exposed to Oracle Forms or concurrent programs as a callable API in the way business packages are; instead, other PL/SQL packages call it when they need to construct and execute dynamic SQL at runtime, for example when querying flexfield-derived structures or building queries whose shape depends on configuration. Because it relies on DBMS_SQL, it can be used for statements that native static SQL cannot express, including dynamically determined column lists. Developers extending EBS should prefer supported public APIs; FND_DSQL should be regarded as internal infrastructure. Any use in custom code should be validated against the target release, since the documented procedure set is exposed without parameter signatures and the package is subject to change between 12.1.1 and 12.2.2.