1748280 Members
4095 Online
108761 Solutions
New Discussion юеВ

Re: dbms_output

 
SOLVED
Go to solution
John Flanagan
Regular Advisor

dbms_output

Is it possible to use dbms_output.put_line to print a blank line?

also

When outputing a data line can this start with spaces?

Regards,

John.
5 REPLIES 5
Yogeeraj_1
Honored Contributor

Re: dbms_output

hi,

use chr(10) for blank lines...
Tried these:

yd@MYDB.MU> exec dbms_output.put_line('Hello');
Hello

PL/SQL procedure successfully completed.

Elapsed: 00:00:01.94
yd@MYDB.MU> exec dbms_output.put_line(chr(10)||'Hello'||chr(10));

Hello


PL/SQL procedure successfully completed.

Elapsed: 00:00:00.00
yd@MYDB.MU>

hope this helps!

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Graham Cameron_1
Honored Contributor

Re: dbms_output

John

Blank lines can be done just with

dbms_output.put_line('') ;


If you want to use leading spaces, you need to specify FORMAT WRAP before firing off the pl/sql

eg
SET SERVEROUTPUT ON SIZE 1000000 FORMAT WRAP

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Yogeeraj_1
Honored Contributor

Re: dbms_output

hi again,

for leading spaces, the best i could do till now is:

yd@MYDB.MU> exec dbms_output.put_line('.'||' '||'Hello');
. Hello

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.48

working on it

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
John Flanagan
Regular Advisor

Re: dbms_output

Hi,

The only solution that seems to work is '.'. I have been using this but it does not give the best output. The chr(10) solution seems to skip 2 lines.

Regards,

John.
R. Allan Hicks
Trusted Contributor
Solution

Re: dbms_output

If you don't mind the ringing in your ears, you might try this....

1 begin
2 dbms_output.enable(200000);
3 dbms_output.put_line('Line 1');
4 dbms_output.put_line(chr(7));
5 dbms_output.put_line('Line 2');
6* end;
SQL> /
Line 1

Line 2

PL/SQL procedure successfully completed.

SQL>

The chr(7) is the bell character which won't print and should be benign to most printers and terminals. You could try some other unprintable characters like chr(1) stx if memory serves. It didn't bother my hpterm emulator.

good luck
"Only he who attempts the absurd is capable of achieving the impossible