Re: Right justify
Posted in 1999
Topics: General Discussion
I was not able to duplicate this on a 9.13 flavor of the engine, what version are you using? NOTE: I defined a char(30) field called col1 in tab, then did: select length(col1) padded, length(trim(col1)) trimmed, col1 from tab; For all of them I got their true length (without padding spaces). Bill Zega (billz@netlabs.net) wrote: : Are there any right_justify functions out there? I need a function that : receives a character parameter (char(100) max), and returns the parameter : right justified. My main problem is that I cannot figure out how to size a : char variable INCLUDING trailing spaces. Example: : char_var char(10) : let char_var="abc " : # Note: length(char_var)=3, not 10 : let char_var=right_justify(char_var) : char_var should now be " abc" (7 spaces, "abc") : Thanks! -- Rob Wilson rwilson@ntsource.com
Thanks for responding but this is an Informix 4gl question, it has nothing to do with the database engine. I simply need a generic Informix 4gl function to right justify strings of different logical lengths, lengths no more than 100 characters. Thanks again. Rob Wilson wrote in message ... >I was not able to duplicate this on a 9.13 flavor of the engine, what version >are you using? > >NOTE: I defined a char(30) field called col1 in tab, then did: > >select length(col1) padded, length(trim(col1)) trimmed, col1 from tab; > >For all of them I got their true length (without padding spaces). > >