Home » SQL & PL/SQL » SQL & PL/SQL » DBMS_OUTPUT.PUT_LINE & spaces
DBMS_OUTPUT.PUT_LINE & spaces [message #321029] Sun, 18 May 2008 04:38 Go to next message
ontilt
Messages: 2
Registered: May 2008
Junior Member
I need to print lines using long spaces using DBMS_OUTPUT.PUT_LINE().

Ive tried it like this:

DBMS_OUTPUT.PUT_LINE('some text' || ' ' || 'some more text')

But it only gives me one space, no matter how many times i include the ' '.

The output I need is similar to the following: (the long underscores represent the spacing i need. I had to do it this way because my post preview wasnt showing spaces.)


TO: User____________________________________Date: xx/xx/xx
ADDRESS: xxxx

Some text here.............................................
...........................................................
...........................................................

Signed: xxxx



Please help! Thanks.
Re: DBMS_OUTPUT.PUT_LINE & spaces [message #321031 is a reply to message #321029] Sun, 18 May 2008 05:14 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Unless you watch it in a web browser, spaces are kept:
SQL> begin
   2   dbms_output.put_line ('123456789');
   3   dbms_output.put_line ('1       9');
   4 end;
   5 /

123456789
1       9

Instruction traitée.

Regards
Michel
Re: DBMS_OUTPUT.PUT_LINE & spaces [message #321032 is a reply to message #321031] Sun, 18 May 2008 05:24 Go to previous messageGo to next message
ontilt
Messages: 2
Registered: May 2008
Junior Member
Thanks for the reply. I tried that and I only get a single space between the numbers, like so:

dbms_output.put_line ('1_________9');

output: 1 9

[Updated on: Sun, 18 May 2008 05:25]

Report message to a moderator

Re: DBMS_OUTPUT.PUT_LINE & spaces [message #321033 is a reply to message #321032] Sun, 18 May 2008 06:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You did it wrong. Copy and paste your session just like I did it.

Before read OraFAQ Forum Guide, "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Use the "Preview Message" button to verify.

Regards
Michel

[Updated on: Sun, 18 May 2008 06:18]

Report message to a moderator

Re: DBMS_OUTPUT.PUT_LINE & spaces [message #321035 is a reply to message #321032] Sun, 18 May 2008 09:30 Go to previous message
Barbara Boehmer
Messages: 8636
Registered: November 2002
Location: California, USA
Senior Member
What are you running it from? If running it from SQL*Plus, you should not have a problem. If running it form APEX or something else, please see the following thread:

http://www.orafaq.com/forum/m/300680/43710/?srch=nbsp#msg_300680

Previous Topic: Question in Pl/Sql Joins
Next Topic: How to optmise the SQL Statement to delete one lakh records ?
Goto Forum:
  


Current Time: Fri Dec 09 23:05:52 CST 2016

Total time taken to generate the page: 0.11294 seconds