Search Results print_support_csv
Overview
QP_DEBUG_UTIL is a utility package owned by APPS and classified as a UTIL API within Oracle E-Business Suite. It provides the diagnostic and instrumentation infrastructure used by the Oracle Advanced Pricing (QP) and Order Management (OE) modules to capture, time-stamp, and emit debug output during runtime processing. The package is authored with AUTHID CURRENT_USER and therefore executes with the privileges of the calling schema, allowing it to be embedded safely within both seeded and custom code paths.
The package centralizes two distinct concerns. The first is hierarchical time logging: developers wrap processing steps in TSTART/TSTOP calls so that elapsed time, call counts, and parent-child relationships are accumulated and can later be dumped for performance analysis. The second is data serialization for diagnostics, exposing a set of PRINT_*_CSV procedures (including PRINT_QUERY_DATA_CSV, the routine most commonly associated with the search term "print_query_data_csv") that render arbitrary SQL result sets, cursor contents, and PL/SQL collections as comma-separated values for inspection. Debug verbosity is governed by the ONT_DEBUG_LEVEL and QP_DEBUG profile options, read at package initialization into G_Debug_Level and G_qp_debug.
Key Procedures and Functions
- WRITE_OUTPUT — Emits a single line of debug text to the configured output destination.
- TSTART — Marks the beginning of a timed section, registering a marker and optional description and initializing timing accumulators.
- TSTOP — Closes a timed section previously opened by TSTART, computing elapsed and cumulative time.
- TDUMP — Writes the accumulated time stack to the debug output, including call counts and totals per marker.
- TFLUSH — Clears the in-memory time and call stacks, resetting instrumentation state.
- ISQPDEBUGON — Returns a Boolean indicating whether pricing-level debug is currently enabled.
- ISTIMELOGDEBUGON — Returns a Boolean indicating whether time-log debug output is enabled.
- PRINT_TABLE_DATA_CSV — Renders tabular data as CSV for diagnostic review.
- PRINT_QUERY_DATA_CSV — Executes a supplied query and formats the resulting rows as CSV output.
- PRINT_CURSOR_DATA_CSV — Formats the contents of an open cursor as CSV.
- PRINT_QUERYLIST_DATA_CSV — Formats a query list collection as CSV.
- PRINT_SUPPORT_CSV and PRINT_DEVELOPMENT_CSV — Emit pre-defined diagnostic data sets intended for support and development troubleshooting respectively.
- SETCURRENTEVENT — Records the current pricing event context in G_CURR_PRICE_EVENT.
- ADDSUMMARYTIMELOG and DUMPSUMMARYTIMELOG — Populate and emit the summarized time log structure introduced under Bug# 8933551.
- SETATTRIBUTE and GETATTRIBUTE — Store and retrieve arbitrary named attributes in the g_comm_attribs associative array.
Tables Accessed
QP_DEBUG_UTIL does not read or write application business tables. All database access is limited to infrastructure objects referenced through APPS synonyms: DBMS_SQL, DBMS_UTILITY, DUAL, PLITBLM, and UTL_FILE. UTL_FILE is used to write CSV and debug output to server-side files, DBMS_SQL and DBMS_UTILITY support dynamic query execution and stack inspection, and PLITBLM provides support for PL/SQL table manipulation. DUAL is used for trivial single-row evaluations.
Usage Notes
The package is referenced by seven other packages and is typically invoked from Oracle Forms, concurrent programs, and custom PL/SQL that operates within the pricing and order management flow. Its CSV procedures are most valuable when diagnosing pricing engine behavior in a development or test instance, where output can be directed to a file via UTL_FILE and then reviewed directly. Because output volume scales with query size and debug level, PRINT_QUERY_DATA_CSV and its siblings should be enabled only when QP_DEBUG or ONT_DEBUG_LEVEL profile settings are active, and should not be left enabled in a production instance.