|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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?) |
![]() |
| Viewing: Dev Shed Forums > Databases > DB2 Development > RTRIM is not truncating trailing spaces at the end of the line |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|