Home » SQL & PL/SQL » SQL & PL/SQL » LPAD in select
LPAD in select [message #250346] Mon, 09 July 2007 13:41 Go to next message
feroze
Messages: 144
Registered: September 2005
Location: chicago
Senior Member
Hi,

select remiter_name,check_no  from remit;


ABC,123


datatype of these 2 columns is varchar2(25) and number(9)

But in display i want

**************ABC --- I mean it should pad the name so that the total length becomes 100 including the column value

same with number ************123456789 --- total length here also should be 100,


How can i do this in select.


Thanks
Re: LPAD in select [message #250347 is a reply to message #250346] Mon, 09 July 2007 13:47 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You already posted the solution in your title:
SQL> select lpad(to_char(123),10,'*') n from dual;
N
----------
*******123

1 row selected.

Regards
Michel
Previous Topic: Passing variables in cursor
Next Topic: what happens to dbms_scheduler.create_job's when import
Goto Forum:
  


Current Time: Sat Dec 10 06:55:58 CST 2016

Total time taken to generate the page: 0.08386 seconds