Home » SQL & PL/SQL » SQL & PL/SQL » Space Printing problem...
Space Printing problem... [message #201275] Fri, 03 November 2006 06:27 Go to next message
deepayan
Messages: 51
Registered: December 2005
Member
Dear all,

I need to make a PL/SQL Report.For that I need to print some blank spaces.
For Example : If I need to print 5 spaces then
select ' ' from dual ; will work.
but I have to print huze (nearly 80/90) blank space to indent that report.
How can I do that without using the above query?

Select chr(10) from dual; will print one space.. but for more than one space how to proceed??

Thanks in advance.......
Re: Space Printing problem... [message #201280 is a reply to message #201275] Fri, 03 November 2006 06:38 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
I'm not sure why you need to do a select to produce a blank line. How are you producing the output ? Through dbms_Output or something else ?
Re: Space Printing problem... [message #201355 is a reply to message #201280] Fri, 03 November 2006 11:51 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
select rpad(' ', 80)||'hello' from dual


Does your report tool have Left justified/right justified etc?
Re: Space Printing problem... [message #201578 is a reply to message #201275] Sun, 05 November 2006 23:15 Go to previous messageGo to next message
deepayan
Messages: 51
Registered: December 2005
Member
hi Cthulhu/Andrews,
Thanks for your reply.. This an oracle apps PL/SQL report (not an rdf which is made through oracle report builder). The outout is produced by
fnd_file.put_line(fnd_file.output,<output_string>).
for this kind of reports no specific report tool is used.The output will be generated by a PL/SQL procedure only..




Re: Space Printing problem... [message #201582 is a reply to message #201578] Sun, 05 November 2006 23:28 Go to previous messageGo to next message
Admin@Lightsql.Com
Messages: 36
Registered: November 2006
Member

deepayan,

Did you try rpad <output_string> as you know rpad just pad at the right of any string?

Jayg
Fun Programming with Oracle & Visual C++, Author of lightsql

Re: Space Printing problem... [message #201589 is a reply to message #201275] Sun, 05 November 2006 23:54 Go to previous message
deepayan
Messages: 51
Registered: December 2005
Member
finally I found rpad(column_name,35,' ') is working fine.
It will print (35-length_of_variable_in_column_name)number of spaces..

thanks to all ...
Previous Topic: Missing Parenthesis error
Next Topic: Ref Cursor SQL*plus
Goto Forum:
  


Current Time: Sun Dec 04 08:53:33 CST 2016

Total time taken to generate the page: 0.22729 seconds