Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Trailing blanks in DBMS_OUTPUT

Re: Trailing blanks in DBMS_OUTPUT

From: Chuck Hamilton <chuck_hamilton_at_yahoo.com>
Date: Mon, 3 Jul 2000 07:14:01 -0700 (PDT)
Message-Id: <10547.111109@fatcity.com>


--0-1714636915-962633641=:20918
Content-Type: text/plain; charset=us-ascii

 I ran into this same problem once. I think the solution I used was to insert the output lines into a table and spool out the table when the pl/sql block had finished. (Be sure that trimspool is off). Another option that comes to mind is if this is unix, you could redirect the output into an awk filter that reoutputs it with a printf. This should give you a good starting point. sqlplus -s user/password @sql | awk '{printf "%-80.80s\n",$0}' > output.txt   Paul van Dijken <paul.vandijken_at_sema.nl> wrote: Dear listers,

For some bizarre reason, I want to print some lines using DBMS_OUTPUT with some lines extended to 80 characters using trailing blanks. To do this, I want to end these lines with a variety of spaces. Most of the lines howeverdo not have trailing blanks. I re-direct my default output to a file (I'm using HP-UX here).

When I do this, DBMS_OUTPUT removes the trailing blanks.

Using SQL*Plus and spool is not allowed, since most of the lines may not have trailing blanks
Using a . or a , or a ; at the end of the line is also not allowed.

Does anyone know how to do this ?

Thanks,
Paul

o===============================o

| Paul van Dijken |
| Sema Group Informatica BV |
| Van Houten Industriepark 11 |
| P.O. Box 143 |
| 1380 AC Weesp |
| The Netherlands |
| Phone : (+31) (0) 294-239500 |
| Fax : (+31) (0) 294-239501 |
| e-mail:Paul.Vandijken_at_sema.nl |
O===============================O

This e-mail is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Sema Group.
If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited.

If you have received this e-mail in error, please notify Sema Group Informatica by telephone on (+31) 294 239 500.

-- 
Author: Paul van Dijken
INET: paul.vandijken_at_sema.nl

Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).


---------------------------------
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
--0-1714636915-962633641=:20918
Content-Type: text/html; charset=us-ascii

<P> I ran into this same problem once. I think the solution I used&nbsp;was to insert the output lines into a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; table and spool out the table when the pl/sql block had finished. (Be sure that trimspool is off). Another option that comes to mind is if this is unix, you could redirect the output into an awk filter that reoutputs it with a printf. This should give you a good starting point.
<P>sqlplus -s user/password @sql | awk '{printf "%-80.80s\n",$0}' &gt; output.txt
<P>&nbsp; <B><I>Paul van Dijken &lt;paul.vandijken_at_sema.nl&gt;</I></B> wrote: <BR>
<BLOCKQUOTE style="BORDER-LEFT: #1010ff 2px solid; MARGIN-LEFT: 5px; PADDING-LEFT: 5px">Dear listers,<BR><BR>For some bizarre reason, I want to print some lines using DBMS_OUTPUT with<BR>some lines extended to 80 characters using trailing blanks. To do this, I<BR>want to end these lines with a variety of spaces. Most of the lines<BR>howeverdo not have trailing blanks. I re-direct my default output to a file<BR>(I'm using HP-UX here). <BR><BR>When I do this, DBMS_OUTPUT removes the trailing blanks. <BR><BR>Using SQL*Plus and spool is not allowed, since most of the lines may not<BR>have trailing blanks<BR>Using a . or a , or a ; at the end of the line is also not allowed.<BR><BR>Does anyone know how to do this ?<BR><BR>Thanks,<BR>Paul<BR><BR>o===============================o<BR>| Paul van Dijken |<BR>| Sema Group Informatica BV |<BR>| Van Houten Industriepark 11 |<BR>| P.O. Box 143 |<BR>| 1380 AC Weesp |<BR>| The Netherlands |<BR>| Phone : (+31) (0) 294-239500 |<BR>| Fax : (+31)!
 (0) 294-239501 |<BR>| e-mail:Paul.Vandijken_at_sema.nl |<BR>O===============================O<BR><BR>This e-mail is confidential and intended solely for the use of the<BR>individual to whom it is addressed. Any views or opinions presented are<BR>solely those of the author and do not necessarily represent those of Sema<BR>Group.<BR>If you are not the intended recipient, be advised that you have received<BR>this e-mail in error and that any use, dissemination, forwarding, printing<BR>or copying of this e-mail is strictly prohibited.<BR><BR>If you have received this e-mail in error, please notify Sema Group<BR>Informatica by telephone on (+31) 294 239 500.<BR><BR><BR>-- <BR>Author: Paul van Dijken<BR>INET: paul.vandijken_at_sema.nl<BR><BR>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051<BR>San Diego, California -- Public Internet access / Mailing Lists<BR>--------------------------------------------------------------------<BR>To REMOVE yourself from this mailing list, s!
end an E-Mail message<BR>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in<BR>the message BODY, include a line containing: UNSUB ORACLE-L<BR>(or the name of mailing list you want to be removed from). You may<BR>also send the HELP command for other information (like subscribing).</BLOCKQUOTE><p><br><hr size=1><b>Do You Yahoo!?</b><br>
Kick off your party with Yahoo! Invites.
Received on Mon Jul 03 2000 - 09:14:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US