1

I am using oracle SQL developer and I have an AFTER UPDATE ON trigger that I would like to get some debug output from, something like 'Inserted 5 rows into table A';

I have tried doing this with dbms_output, calling

dbms_ouput.put_line('mytext')

with the text that I want printed. However, even when my trigger activates, I don't get any output on the dbms output windows (yes I have enabled dbms output and activated the connection in the dbms output panel).

I assume that is because the output is buffered and I need to somehow flush it? If yes how do I do that? Should I even be using dbms_output to accomplish what I need?

APC
  • 144,005
  • 19
  • 170
  • 281
krise
  • 485
  • 1
  • 10
  • 22
  • 1
    How did you enable output - `set serveroutput on`, or menu option View->Dbms Output? If the latter did you add the connection in the 'Dbms Output' panel? And how are you running the triggering statement, as a script (F5) as as a statement (control-enter)? Using `dbms_output` to debug something is fine, it's only really a problem to rely on it in general use, as it might not be enabled. Without knowing what you trigger is doing or when (or if) it's firing we can't really say if there's a better way - we don't really know what you need. – Alex Poole Aug 16 '19 at 08:34
  • Hi thanks for the answer, I have enabled the output via View->Dbms Output and yes I activated 'Enable DBMS output for connection' in the panel. I am not sure what you mean with your second question, my trigger is a AFTER UPDATE ON trigger, so it runs when I make an update to the respective table. – krise Aug 16 '19 at 08:48
  • 1
    Then that suggests your trigger isn't actually firing, or at least isn't reaching the `dbms_output`line. Without seeing the trigger, existing data and your update statement we don't know why that might be. – Alex Poole Aug 16 '19 at 09:22
  • In addition to view Dbms Output panel you might need to click the plus icon (or Ctrl-N) for enable it to correct connection. – Johannes Tuikkala Mar 07 '23 at 08:16

0 Answers0