Search Results print_table_data_csv
Overview
QP_DEBUG_UTIL is a diagnostic and instrumentation utility package owned by the APPS schema in Oracle E-Business Suite Release 12.1.1 and 12.2.2. It is classified as a UTIL package within the Oracle Pricing (QP) module and is declared with AUTHID CURRENT_USER, meaning it executes with the privileges of the calling user rather than the definer. Its primary business function is to provide developers and support engineers with a consistent framework for emitting debug output and capturing timing information from Oracle Pricing and adjacent Oracle Order Management (ONT) code paths. The package is deliberately non-shipping (the header tag noship indicates it is not part of the shipped production application), and it is controlled at runtime through the profile options ONT_DEBUG_LEVEL and QP_DEBUG, read once into package globals G_Debug_Level and G_qp_debug.
The package exposes a time-tracking stack (t_TimeStack, t_CallStack) and a summary log stack (t_SummarLogStack, added under Bug# 8933551) that together allow hierarchical instrumentation of pricing engine calls, recording markers, descriptions, elapsed time, call counts, parent identifiers and running state.
Key Procedures and Functions
- WRITE_OUTPUT — Emits a single line of debug text to the configured output sink.
- TSTART — Opens a timing marker, optionally with a description, accumulation flag and put-line flag; pushes an entry onto the internal time stack.
- TSTOP — Closes the named timing marker and records elapsed time and call count.
- TDUMP — Renders the accumulated timing stack as formatted output.
- TFLUSH — Flushes pending debug/timing buffers.
- ISQPDEBUGON — Returns a Boolean indicating whether QP-level debug is currently enabled.
- ISTIMELOGDEBUGON — Returns a Boolean indicating whether time-log debug is enabled.
- PRINT_TABLE_DATA_CSV — Formats tabular data as comma-separated values, the procedure most commonly associated with the user search term print_table_data_csv.
- PRINT_QUERY_DATA_CSV — Executes and formats a query's result set as CSV.
- PRINT_CURSOR_DATA_CSV — Formats the results of an open cursor as CSV.
- PRINT_QUERYLIST_DATA_CSV — Formats a query_list collection (a PL/SQL associative array of VARCHAR2 indexed by BINARY_INTEGER) as CSV.
- PRINT_SUPPORT_CSV and PRINT_DEVELOPMENT_CSV — Purpose-specific CSV emitters used to produce support-facing and development-facing diagnostic extracts.
- SETCURRENTEVENT — Sets G_CURR_PRICE_EVENT, the current pricing event context used in debug output.
- ADDSUMMARYTIMELOG and DUMPSUMMARYTIMELOG — Populate and emit the summary time log introduced by Bug# 8933551, including padding attributes for formatted rendering.
- SETATTRIBUTE and GETATTRIBUTE — Manage name/value pairs in the g_comm_attribs collection, keyed by VARCHAR2 (up to 500 characters) with values up to 5000 characters.
Tables Accessed
QP_DEBUG_UTIL does not read or write application business tables. Its documented data dictionary and dependency references are limited to DBMS_SQL, DBMS_UTILITY, DUAL, PLITBLM and UTL_FILE, accessed through APPS synonyms. DBMS_SQL is used to parse and execute the dynamic SQL behind the query and cursor CSV printers; DBMS_UTILITY and DUAL support utility and selection operations; PLITBLM is the PL/SQL integer-to-BLOB helper used in formatting output; and UTL_FILE provides file-based output when the debug sink is directed to the file system rather than the standard output mechanism. All diagnostic state is held in package-level PL/SQL collections rather than persisted tables.
Usage Notes
The package is invoked exclusively from other PL/SQL constructs — the Oracle Pricing engine, order capture logic and custom extensions — rather than from an Oracle Forms UI. Debug emission is gated by the ONT_DEBUG_LEVEL and QP_DEBUG profile options, so the CSV printers and timing procedures are effectively dormant in a standard production configuration and are enabled only during investigation or support escalation. The package is referenced by seven other packaged objects within the E-Business Suite, confirming its role as a shared utility rather than an entry-point API. Because of AUTHID CURRENT_USER, callers must hold the necessary privileges (notably on UTL_FILE and the objects being inspected) for output to succeed. Developers instrumenting custom pricing or order code should treat QP_DEBUG_UTIL and its CSV printers as a read-only diagnostic aid and should not build functional dependencies on its output format.