Re: trimming chars
Posted in 1998
Ronnie Diaz wrote: > > I'm using the trim function on a char field (getting rid of trailing > whitespaces), and it usually works unless the text is more than 255 > characters since the object returned to me is a varchar. Does anyone > know of a way to get trim trailing whitespaces for strings longer than > 255 chars? Unless I'm missing something (which I usually do) it's silly > that varchars can only be 255 chars long. I assume you are using ESQL/C. In this case change the target host data type from 'varchar' to 'string'. This is a normal "C" string which is AUTOMATICALLY stripped of trailing spaces ONLY and NULL terminated (so declare an additional character to hold the NULL for full columns). The type string is not limited to 255 chars and you do not have to explicitely TRIM the result. Art S. Kagel