This is a discussion on More DB2 RTrim() problems... within the DB2 forums, part of the Database Server Software category; --> Hi, On an AIX box using DB2 version 7.1, I've got a table with one particular column which may ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, On an AIX box using DB2 version 7.1, I've got a table with one particular column which may (infrequently) be quite large. The table description is as follows: db2 => describe table flpwebmsgq Column Type Type name schema name Length Scale Nulls ------------------------------ --------- ------------------ -------- ----- ----- UID SYSIBM INTEGER 4 0 No TIME SYSIBM TIMESTAMP 10 0 No TYPE SYSIBM VARCHAR 32 0 No BODY SYSIBM VARCHAR 15000 0 No 4 record(s) selected. When I do a select on the table, the displaying of the "body" column makes it basically unreadable for more than one line. What I'd like to be able to do is something like: select uid,time,type,rtrim(body) from flpwebmsgq; This would make it much more readable We also have a bunch of other tables where the column is defined as VARCHAR(254) because there is the possibility of larger data in the future, but currently we are only using a portion of the column's width. So a solution to the above problem would be helpful for a lot of different tables when we are trying to verify test results or debug a problem. Any help is appreciated. Kyle |
| |||
| Is your problem the result of the display in the db2 command line processor? If so, that is not an RTRIM issue, but an artefact of the way the db2 command processor displays columns with their maximum defined length (to ensure no truncation). In that case, the solution is to use a more intelligent utility for displaying data - there are lots of these. "Kyle" <Kyle_Dyer@hotmail.com> wrote in message news:a692bab1.0309041325.a82822b@posting.google.co m... > Hi, > > On an AIX box using DB2 version 7.1, I've got a table with one > particular column which may (infrequently) be quite large. The table > description is as follows: > > db2 => describe table flpwebmsgq > > Column Type Type > name schema name Length > Scale Nulls > ------------------------------ --------- ------------------ -------- > ----- ----- > UID SYSIBM INTEGER 4 > 0 No > TIME SYSIBM TIMESTAMP 10 > 0 No > TYPE SYSIBM VARCHAR 32 > 0 No > BODY SYSIBM VARCHAR 15000 > 0 No > > 4 record(s) selected. > > When I do a select on the table, the displaying of the "body" > column makes it basically unreadable for more than one line. What I'd > like to be able to do is something like: > > select uid,time,type,rtrim(body) from flpwebmsgq; > > This would make it much more readable We also have a bunch of > other tables where the column is defined as VARCHAR(254) because there > is the possibility of larger data in the future, but currently we are > only using a portion of the column's width. So a solution to the > above problem would be helpful for a lot of different tables when we > are trying to verify test results or debug a problem. > > Any help is appreciated. > > Kyle |
| ||||
| Kyle <Kyle_Dyer@hotmail.com> wrote: > Hi, > > On an AIX box using DB2 version 7.1, I've got a table with one > particular column which may (infrequently) be quite large. The table > description is as follows: > > db2 => describe table flpwebmsgq > > Column Type Type > name schema name Length > Scale Nulls > ------------------------------ --------- ------------------ -------- > ----- ----- > UID SYSIBM INTEGER 4 > 0 No > TIME SYSIBM TIMESTAMP 10 > 0 No > TYPE SYSIBM VARCHAR 32 > 0 No > BODY SYSIBM VARCHAR 15000 > 0 No > > 4 record(s) selected. > > When I do a select on the table, the displaying of the "body" > column makes it basically unreadable for more than one line. What I'd > like to be able to do is something like: > > select uid,time,type,rtrim(body) from flpwebmsgq; Pipe the output into "less": db2 "select uid,time,type,rtrim(body) from flpwebmsgq" | less -S Then you can use the arrow keys on the keyboard to scroll up/down and left/right to view the complete output. -- Knut Stolze Information Integration IBM Germany / University of Jena |