DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old June 10th, 2005, 10:32 AM
reddyengineer reddyengineer is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 1 reddyengineer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m
Reputation Power: 0
RTRIM is not truncating trailing spaces at the end of the line

Hi,
I am using the following sql statement

SELECT rtrim(rtrim(coalesce(substr(char(v.creationdate),1,4) || '-' || substr(char(v.creationdate),6,2) || '-' || substr(char(v.creationdate),9,2) || ' ' || substr(char(v.creationdate),12,2) || ':' || substr(char(v.creationdate),15,2) || ':' || substr(char(v.creationdate),18,2), '')) ||'~'
|| rtrim(coalesce(substr(char(v.lastmodifieddate),1,4) || '-' || substr(char(v.lastmodifieddate),6,2) || '-' || substr(char(v.lastmodifieddate),9,2) || ' ' || substr(char(v.lastmodifieddate),12,2) || ':' || substr(char(v.lastmodifieddate),15,2) || ':' || substr(char(v.lastmodifieddate),18,2), '')) ||'~'
|| rtrim(coalesce(substr(char(v.escalationdate),1,4) || '-' || substr(char(v.escalationdate),6,2) || '-' || substr(char(v.escalationdate),9,2) || ' ' || substr(char(v.escalationdate),12,2) || ':' || substr(char(v.escalationdate),15,2) || ':' || substr(char(v.escalationdate),18,2), '')) ||'~'
|| rtrim(coalesce(v.status, ''))||'~'
|| rtrim(coalesce(v.referralnumber, ''))||'~'
|| rtrim(coalesce(v.casenumber, '')) ||'~'
|| rtrim(coalesce(v.CONTRACTNUMBER , '')) ||'~'
|| rtrim(coalesce(v.CONTRACTSUFFIX, '')) ||'~'
|| rtrim(coalesce(v.CONTRACTGROUPNUMBER, '')) ||'~'
|| rtrim(coalesce(v.destinationgroup, '')) ||'~'
|| rtrim(coalesce(v.originatingcsclastname, '')) ||'~'
|| rtrim(coalesce(v.originatingcscfirstname, '')) ||'~'
|| rtrim(coalesce(cs.lname, '')) ||'~'
|| rtrim(coalesce(cs.fname, '')) ||'~'
|| rtrim(coalesce(c.lname, '')) ||'~'
|| rtrim(coalesce(c.fname, '')) ||'~'
|| rtrim(coalesce(v.TYPE, '')) ||'~'
|| rtrim(coalesce(v.followuprequired, '')) ||'~'
|| rtrim(coalesce(v.callbackrequired, '')) ||'~'
|| rtrim(coalesce(v.PRIORITY, '')) ||'~'
|| rtrim(char(days(bd.STARTDATETIME ) - days(v.escalationdate))) ||'~'
|| rtrim(coalesce(v.catagory, '')) ||'~'
|| rtrim(coalesce(v.callgroup, '')) ||'~'
|| rtrim(coalesce(v.CONTACTLASTNAME, '')) ||'~'
|| rtrim(coalesce(v.CONTACTFIRSTNAME, '')) ||'~'
|| rtrim(coalesce(v.DELIVERYADDRLINE, '')) ||'~'
|| rtrim(coalesce(v.CITY, '')) ||'~'
|| rtrim(coalesce(v.STATE, '')) ||'~'
|| rtrim(coalesce(v.ATTN, '')) ||'~'
|| 'TNG')
FROM vcity v, rajusers c, rajusers cs, batches bd
WHERE v.USERID = c.userid
AND v.usersupervisorid = cs.userid
AND v.status not in ('Disposed', 'Finalized')
AND v.callgroupcd = '015'
AND bd.ID = 1
AND (v.creationdate > bd.startdatetime - 7 days
OR v.lastmodifieddate > bd.startdatetime - 7 days)
ORDER BY v.creationdate
;

The output i am getting is

2005-06-01 16:11:53~2005-06-01 16:11:53~2005-06-08 00:00:00~Sent~00000-01314-038~00000-04418-043~969560126028060~~96956~GUL Aurora Accounting~Vakkalagadda~Madhu Babu~Srinivasan~Sridhar~Vakkalagadda~Madhu Babu~Status Of Loan/Withdrawal/Surrender~N~N~1~0~Accounting~GUL~BROWN III~BENJAMIN~8205 CITY LIGHTS DR~ALISO VIEJO~CA~~TNG
2005-06-01 16:44:01~2005-06-01 16:44:01~2005-06-08 00:00:00~Sent~00000-01318-000~00000-04431-000~969560126028060~~96956~GUL Aurora Accounting~Vakkalagadda~Madhu Babu~Srinivasan~Sridhar~Vakkalagadda~Madhu Babu~Apply Suspense Money - Regular~N~N~0~0~Accounting~GUL~BROWN III~BENJAMIN~8205 CITY LIGHTS DR~ALISO VIEJO~CA~~TNG
2005-06-01 16:48:02~2005-06-01 16:48:02~2005-06-08 00:00:00~Sent~00000-01318-002~00000-04431-000~969560126028060~~96956~GUL Escalation~Vakkalagadda~Madhu Babu~Srinivasan~Sridhar~Vakkalagadda~Madhu Babu~Apply Suspense Money - Resource~N~N~0~0~Accounting~GUL~BROWN III~BENJAMIN~8205 CITY LIGHTS DR~ALISO VIEJO~CA~~TNG




There are a lot of spaces between each row of output. Here it is displayed one by one without spaces . but in the actual output there will be a lot of space between each row. How can i eliminate those spaces?? please help.

Reply With Quote
  #2  
Old June 14th, 2005, 09:54 PM
fractalvibes fractalvibes is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Location: Waco, Texas
Posts: 632 fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 14 h 11 m 13 sec
Reputation Power: 22
We can't see what you describe here...how about copying your sql statement and adding the things you are selecting and rtrimming one at a time to see where your problem might be. What are you doing with the output? Are there unaccounted-for spaces within each row you return?

fv
__________________
...because that is the way we have always done it. We've been doing it like that for 80 Years! (How do we change that mindset?)

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > RTRIM is not truncating trailing spaces at the end of the line


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway