简单的评论:
set serveroutput on format wrapped;
begin
DBMS_OUTPUT.put_line('simple comment');
end;
/
-- do something
begin
DBMS_OUTPUT.put_line('second simple comment');
end;
/
你应该得到:
anonymous block completed
simple comment
anonymous block completed
second simple comment
如果你想打印出变量的结果,这里有另一个例子:
set serveroutput on format wrapped;
declare
a_comment VARCHAR2(200) :='first comment';
begin
DBMS_OUTPUT.put_line(a_comment);
end;
/
-- do something
declare
a_comment VARCHAR2(200) :='comment';
begin
DBMS_OUTPUT.put_line(a_comment || 2);
end;
你的输出应该是:
anonymous block completed
first comment
anonymous block completed
comment2