Problems w/ DB2 (7.1 on AIX) trim() function

Problems w/ DB2 (7.1 on AIX) trim() function

Post by Kyl » Wed, 25 Jun 2003 08:28:09



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.

Any help is appreciated.

Kyle

 
 
 

Problems w/ DB2 (7.1 on AIX) trim() function

Post by Knut Stolz » Wed, 25 Jun 2003 15:01:34


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

 
 
 

1. DB2 UDB 7.1 fp3 AIX 4.3.3 db2 command processor and crontab

Assume following entry in crontab:

50 0 * * 0 rm -f /var/tmp/1;su - inst2  -c 'echo "connect to
t1;\\nreorg table sysibm.syssection;" >/var/tmp/1;db2 -vtsf
/var/tmp/1'

inst2 is the owner of an instance with a database t1 in it

When executing within crontab it fails:

connect to t1
DB21016E  The Command Line Processor encountered a system error while
sending
the command to the backend process.

Executing on a terminal the content of the file /var/tmp/1 will work
as expected, the content being:

connect to t1;
reorg table sysibm.syssection;

How to let the command line processor work in crontab?

2. SQL_UPDATE_BY_BOOKMAKR for SQLBulkOperations

3. Problem install DB2 7.1 on AIX 4.3.3

4. Checking version info for Service Packs

5. DB2 7.1 PDE or DB2 7.1 EE

6. export query results to flat file?

7. DB2 PDE 7.1 on RedHat 7.1 problem

8. Problems with EXEC SQL ROLLBACK WORK RELEASE

9. SQL0901N error installing DB2 Enterprise 7.1 on AIX 5.1

10. DB2 7.1 AIX 4.3.3 Files system from normal to large file enabled

11. DB2 UDB 7.1 AIX memory above 2 GB?

12. DB2 7.1 Triggers and User Defined Functions with Cobol program

13. sqlexecd 7.1 problem in AIX 4.2!!