Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get my PUT_LINE statement to display in TOAD?

Tags:

sql

toad

This code compiles, but in TOAD it won't show the "hi wo" output

CREATE OR REPLACE PROCEDURE AdelTest IS
tmpVar NUMBER;

BEGIN

  DBMS_OUTPUT.ENABLE(100: in INTEGER);
  DBMS_OUTPUT.PUT_LINE('hi wo');
    tmpVar := 0;
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
      NULL;
    WHEN OTHERS THEN
      --consider logging error then r-raise
    RAISE;
END AdelTest;

How do I show the output(similar to how println shoots to console in Java ) ?

like image 526
Caffeinated Avatar asked Jul 25 '14 16:07

Caffeinated


1 Answers

You need to enable DBMS Output. If working in the Editor right-click and choose DBMS Output off of the Desktop flyout menu. There's a button that is red if it's disabled. Click it and it will turn green. Then execute your code. Output will display there. If you are working outside of the Editor (in Schema Browser for instance) select DBMS Output off of the main Toad View menu. Enable your output there. Output will display in that window.

like image 152
Michael S. Avatar answered Sep 27 '22 20:09

Michael S.