dbms_output.put_line

I have a trigger that I'm trying to debug using the test window but I cannot seem to get the following things to work for me:

1. dbms_output.put_line - is there a way to get the results to display during execution and not have to wait until the trigger has completely executed to see the results?
2. How do I get the values for :NEW and :OLD to display during an INSERT on a trigger?

I know I must be doing something wrong. Any help would be appreciated.

Thank you.
 
#1 why doyou need that ?
- sounds like that trigger is taking WAY too long
- old is all NULL in an insert trigger.
 
Originally posted by Robert Taylor:
1. dbms_output.put_line - is there a way to get the results to display during execution and not have to wait until the trigger has completely executed to see the results?
Perhaps you could declare a local procedure to do the PUT_LINEs? The debugger would step into that.
 
The :NEW and :OLD variables can indeed not be displayed by the debugger. You will have to assign the individual field values to a local variable to see them:
Code:
declare
  l_emp emp%rowtype;
begin
  l_emp.empno := :new.empno;
  l_emp.ename := :new.ename;
  ...
end;
 
I don't think there is a solution when using dbms_output. You may want to look into the dbms_application_info package though. It allows you to give "output" that is immediately visible in v$session.
 
I've successfully used DBMS_PIPE package for this type of debugging, which allows you to send out messages while the tested procedure is running. The Oracle documentation on it's pretty good.
 
I like to use pipes also for debugging in some cases. Especially when i have trouble reproducing the problem without client app.
 
Back
Top