Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: dbms_output.put_line
In article <64qt7l$hae$1_at_nntp3.interaccess.com> Ari Kaplan, akaplan_at_interaccess.com writes:
>It's not pretty, but it works:
>
>DBMS_OUTPUT.PUT_LINE('col1 col2');
>DBMS_OUTPUT.PUT_LINE(lpad(to_char(col1),4)||lpad(to_char(col2),10));
Erm... it's not pretty, and it doesn't work :)
Seriously, the leading spaces will be stripped off. You probably don't want this to happen. I usually precede output like this with some non-whitespace character to stop this from happening. For example:
DBMS_OUTPUT.PUT_LINE('* col1 col2'); DBMS_OUTPUT.PUT_LINE('* ' || lpad(to_char(col1),4)||lpad(to_char(col2),10));