Home » SQL & PL/SQL » SQL & PL/SQL » How to print space before a number
How to print space before a number [message #214145] Mon, 15 January 2007 02:26 Go to next message
world.apps
Messages: 70
Registered: January 2007
Location: Hyderabad
Member
Hi,

I am trying to write a PL/SQL BLOCK to get a output like printing space behalf of 's' character.


Note: here 's' means space.
sssss1
ssss12
sss123
ss1234
123456

When i give space in the dbms_output.put(' ') it doesn't take the spaces before the numbers.


If anybody knows how to print spaces please help me.

Thanks in advance.

[Updated on: Mon, 15 January 2007 02:31]

Report message to a moderator

Re: How to print space before a number [message #214147 is a reply to message #214145] Mon, 15 January 2007 02:38 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

You can use chr(9) or chr(160);

SQL> exec dbms_output.put_line(chr(9)||chr(9)||'12');

[Updated on: Mon, 15 January 2007 02:38]

Report message to a moderator

Re: How to print space before a number [message #214148 is a reply to message #214145] Mon, 15 January 2007 02:40 Go to previous message
bonker
Messages: 402
Registered: July 2005
Senior Member
try using dbms_output.put_line(lpad(to_char(<<yourfield>>),9))
Previous Topic: suggest a username
Next Topic: COLLATE
Goto Forum:
  


Current Time: Sat Dec 10 11:10:43 CST 2016

Total time taken to generate the page: 0.08768 seconds