15.6 ENABLE_DBMS_OUTPUT Procedure

This procedure writes all debug logs via dbms_output. If debug is disabled, this call also enables it with log level c_log_level_warn. You have to set a debug level higher than c_log_level_warn for finer grained debug output. The output 95 starts with a configurable prefix, followed by the log level, "|" and the actual debug message.

Syntax

ENABLE_DBMS_OUTPUT (
    p_prefix    IN VARCHAR2    DEFAULT '# APEX|' );

Parameters

Table 15-3 ENABLE_DBMS_OUTPUT Procedure Parameters

Parameter Description

p_prefix

Prefix for lines that go to dbms_output, default '# APEX|'.

Example

This sqlplus code writes the debug messages for 4, 5, 7, and 8 via dbms_output.

set serveroutput on size unlimited
begin
 apex_debug.error('1');
 apex_debug.warn('2');
 apex_debug.enable_dbms_output(p_prefix=>'Debug-');
 apex_debug.error('4');
 apex_debug.warn('5');
 apex_debug.info('6');
 apex_debug.enable(p_level=>apex_debug.c_log_level_info);
 apex_debug.info('7');
 apex_debug.enable_dbms_output;
 apex_debug.info('8');
 apex_debug.disable_dbms_output;
 apex_debug.info('9');
end;
 /
Output:
  Debug-ERR|4
  Debug-WRN|5
  Debug-INF|7
  # APEX|INF|8