Home » SQL & PL/SQL » SQL & PL/SQL » SPACE IN PADDING
SPACE IN PADDING [message #362415] Tue, 02 December 2008 04:07 Go to next message
arjunyadav
Messages: 15
Registered: September 2008
Junior Member
Hi Freinds,
I have a script as follows, in this I have taken RPAD OF ' '(space) TILL 55 CHARECTERS,
WHEN I count the length of the padded charecters
it comes 55 chars ,
but if in padding more spaces are coming then whole column value covers less area on the page
and is displayed on the left side,
page but I want 55 characters should cover same area on the application page,
How to do ,kindly show me

SELECT RPAD(SUBSTR(COL.ACCOUNT_NAME, 1, 50), 55, ' ') ||
RPAD(COL.ACCOUNT_HEAD, 6, 0) CNAM_CHG
FROM COLLECTION_MASTER COL
WHERE COL.COLLECTED_BY = '144'
AND COL.COLL_DT = TO_DATE('28-11-2008', 'DD-MM-YYYY')
AND COL.CASHIER_ID IS NOT NULL
AND NVL(COL.CHARGE_CODE, ' ') <> '01'
ORDER BY COL.ACCOUNT_HEAD, COL.RECEIPT_NO;

OUT PUT
=======
1 Temp.Energy Charges 233010
2 Deposits for Low and Medium Voltage Service connec 473010
3 Deposits for Low and Medium Voltage Service connec 473010
4 Deposits for Low and Medium Voltage Service connec 473010
5 Deposits for Low and Medium Voltage Service connec 473010
6 Deposits for Low and Medium Voltage Service connec 473010
7 Deposits for Low and Medium Voltage Service connec 473010
8 Deposits for Low and Medium Voltage Service connec 473010
9 Deposits for Agreements 476020
10 SECURITY DEPOSITS FROM CONSUMERS (IN CASH) 481000
11 SECURITY DEPOSITS FROM CONSUMERS (IN CASH) 481000
12 Reconnection Charges 619020
13 Reconnection Charges 619020
14 Registration Charges for registering application f 619150

the out put appearing here is ok but when it is displayed on the application page then,
appearing numbers some time goes right and some time left
but I want i should be on the page as it is appearing here.
But when I use '*' for padding that time it gets displayed properly without any left or right

Thanks and Regards
Arjun Yadav
Re: SPACE IN PADDING [message #362423 is a reply to message #362415] Tue, 02 December 2008 04:15 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ Don't put your title in UPPER case

2/ Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.

3/ Always post your Oracle version (4 decimals).

Quote:
the out put appearing here is ok

Not at all.
It is absolutly unclear what you have and what you want, show us.

Regards
Michel
Re: SPACE IN PADDING [message #362434 is a reply to message #362415] Tue, 02 December 2008 04:53 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
It sounds like your actual problem is with how your application displays the data.

what language is this application written in?
Previous Topic: balance calculation
Next Topic: tablename or alias as in para and see the table avaible in schema
Goto Forum:
  


Current Time: Sat Dec 03 01:23:04 CST 2016

Total time taken to generate the page: 0.05278 seconds