W3C home > Mailing lists > Public > public-qt-comments@w3.org > September 2004

Request for yet another function - truncating trailing spaces for string values

From: Peter Coppens <pgp.coppens@pandora.be>
Date: Thu, 16 Sep 2004 22:39:25 +0200
To: <public-qt-comments@w3.org>
Message-ID: <E1C833A-0004P3-2q@frink.w3.org>
Gentlepeople,
 
I fully understand that the period for 'functional' comments on the spec is
closed, but as this is information from the 'implementation trenches', just
perhaps a few cycles of some working group member can be diverted for a
moment.
 
I think that for a subset of environments (e.g. those that use XQuery to
query existing relational information) it would be beneficial to have a
function that removes trailing spaces from a string value (as in SQL's rtrim
function).
 
The reason is that fixed character RDBMS columns end up being mapped (per
the SQL 2003 spec) with trailing spaces where needed. That's nice, as it
fully exposes the available RDBMS information, but often these trailing
spaces have no real meaning for the application.
 
The only solution we could find to remove these trailing spaces based on the
currently available F&O's is through something like fn:replace ( 'abc ', '
*$', ''). The need to fall back on regular expressions (often not available
in the different SQL implementations) seems overkill for such a simple an
most likely often needed operation. 
 
Of course we are free to define our own non-standard function and of course
people should not put varying length data in fixed length character columns,
but the case in favour for such a function nevertheless seems strong enough
for me to bother you with this.
 
Thanks,
 
Peter
 
 
 
 
 
 
Received on Thursday, 16 September 2004 20:40:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:34 GMT