我正在使用SQL Developer来调试下面的代码,只有在完成所有存储过程后,输出结果才会显示在调试对话框中。我需要打开一些配置吗?
由于
FOR j IN REVERSE 1..i LOOP
DBMS_OUTPUT.PUT_LINE(emp_tab(j).first_name);
END LOOP;
日志
Connecting to the database hr.
Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '192.168.1.4', '53475' )
Debugger accepted connection from database on port 53475.
Source breakpoint occurred at line 24 of EMP_LIST.pls.
Source breakpoint occurred at line 24 of EMP_LIST.pls.
Source breakpoint occurred at line 24 of EMP_LIST.pls.
Source breakpoint occurred at line 24 of EMP_LIST.pls.
Source breakpoint occurred at line 24 of EMP_LIST.pls.
Source breakpoint occurred at line 24 of EMP_LIST.pls.
Executing PL/SQL: CALL DBMS_DEBUG_JDWP.DISCONNECT()
Shelli
Hermann
David
Mozhe
Sundar
Ellen
Process exited.
Disconnecting from the database hr.
Debugger disconnected from database.
答案 0 :(得分:5)
如果您使用DBMS_OUTPUT
进行调试,则在该过程完成之前您将看不到任何输出。这就是DBMS_OUTPUT
的工作方式。
但是,您似乎已成功使用SQL Developer调试器,这是调试存储过程的一种更有效的方法。您显然正在设置断点,以便可以检查这些断点处的变量值。无需打印值。