Kyle wrote on Tuesday 24 June 2003 01:28:
Quote:> Hi.
> I'm having trouble getting TRIM() to work on a VARCHAR field that is
> 1500 char long or at all for that matter. (Please don't flame me for
> this field, as I didn't create it...just trying to access it)
> The problem I'm having is that it isn't doing the t* and I'm
> getting a huge String out of it.
Could you please post a sample SQL snippet that shows the problem and also let
us know which version of DB2 you are using?
In DB2 LUW, there is an LTRIM and an RTRIM function. Which one of the two are
you using?
Are you sure that the _data_ is really not trimmed? It can very well be that
the data is trimmed but if you execute your statement on the DB2 command
line, you will see a large table header (many ------) because DB2 will not
know the maximum length of all the values returned for this column before
they are all fetched. Thus, it will assume the longest column length
possible, 1500 characters in your case. You can simply verify if that's the
case with a statement like this:
FROM sysibm.sysdummy1
1
1 record(s) selected.
--
Knut Stolze
Information Integration
IBM Germany / University of Jena