Print text in Oracle SQL Developer SQL Worksheet window
for simple comments:
set serveroutput on format wrapped;begin DBMS_OUTPUT.put_line('simple comment');end;/-- do somethingbegin DBMS_OUTPUT.put_line('second simple comment');end;/
you should get:
anonymous block completedsimple commentanonymous block completedsecond simple comment
if you want to print out the results of variables, here's another example:
set serveroutput on format wrapped;declarea_comment VARCHAR2(200) :='first comment';begin DBMS_OUTPUT.put_line(a_comment);end;/-- do somethingdeclarea_comment VARCHAR2(200) :='comment';begin DBMS_OUTPUT.put_line(a_comment || 2);end;
your output should be:
anonymous block completedfirst commentanonymous block completedcomment2
PROMPT text to print
Note: must use Run as Script (F5)not Run Statement (Ctl + Enter)
You could set echo to on:
set echo onREM Querying tableselect * from dual;
In SQLDeveloper, hit F5 to run as a script.