Q:

PL/SQL Alias for DBMS_OUTPUT.PUT_LINE()?

Simple question, is it possible to give an alias to the output function in the question title so that I can call something like trace('hello') rather than DBMS_OUTPUT.PUT_LINE('hello')?
I would like this because I use output to help with debugging and I am tired of typing that whole function name out and/or copy and pasting it all the time.
Thanks for your time.

A:

Just create a procedure to wrap the call:
create or replace procedure trace(v_message in VARCHAR2)
as
begin
    dbms_output.put_line(v_message);
end;

Usage:
SQL> begin
  2  trace('hello');
  3  end
  4  ;
  5  /

PL/SQL procedure successfully completed.

SQL> set serverout on size 1000000
SQL> /
hello

PL/SQL procedure successfully completed.

