Hi Michael,
if you investigate the result file you might find that there is one
empty row at the start and 3 empty rows at the end of the file.
Even the switch "-x" adds one empty row at the end.
regards,
Norbert
michael.bierenfeld@web.de - 26 Sep 2005 16:12 GMT
Yes ! And then ... ?-)
-x means suppress column headers. It does not seem to be so simple.I
think I gonna write a small perl/python script
Norbert Munkel - 26 Sep 2005 16:29 GMT
Michael,
michael.bierenfeld@web.de schrieb:
> Yes ! And then ... ?-)
>
> -x means suppress column headers. It does not seem to be so simple.I
> think I gonna write a small perl/python script
This was just to show you that this is no option as well and db2 is
_NOT_ wrapping lines. Sorry for the confusion.
For nagios, I would write a wrapper around that which gives proper
return-codes and just one short line of (HTML) text linking to the
"long"-Output.
regards,
Norbert
> it *does* at least this one :-)
>
[quoted text clipped - 7 lines]
> HI_ADDITIONAL_INFO
> ----------------------------- -------------------- --------
----------------------------------------------------------------------------------------------------
> 0 Satz/Sätze ausgewählt.
Have a look at /var/tmp/lala using "ls -S" as it will preserve the line
wraps exactly as they are in the file. You'll see that DB2 does not
include any <cr>s.

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
michael.bierenfeld@web.de - 28 Sep 2005 10:08 GMT
Hi there,
_it_ _does_ .... The following pipe Script recognizes them and filters
them out. The Problem is solved for me. I will post the
"nagios-pluggin" to the nagios projekt
#!/usr/bin/env python
# -*- coding: latin_1 -*-
# $Id:$
import os
import sys
import string
# ---------------------------------------------------------------------
def wrapit (data, stdout):
wrapped = data.replace ("\n", " ").split ("XXXX")
for line in wrapped:
stdout.write (line)
return
# ---------------------------------------------------------------------
if __name__ == "__main__":
stdin = sys.stdin
stdout = sys.stdout
data = stdin.read ()
wrapit (data, stdout)
Knut Stolze - 28 Sep 2005 12:05 GMT
> Hi there,
>
> _it_ _does_ .... The following pipe Script recognizes them and filters
> them out. The Problem is solved for me. I will post the
> "nagios-pluggin" to the nagios projekt
Seriously, DB2 does not include any line breaks in the middle of the rows
(only at the end of each row, of course). So you are addressing symptoms
if your output or changes that come from another place.

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
michael.bierenfeld@web.de - 29 Sep 2005 13:06 GMT
*hm* :-) we must have some critters inserting <cr>'s. I am talking
about
db2inst1@db2host:/home/db2inst1 # db2
(c) Copyright IBM Corporation 1993,2002
Befehlszeilenprozessor für DB2 SDK 8.2.3
Running on AIX 5.2
Regards
Michael
Knut Stolze - 29 Sep 2005 16:08 GMT
> *hm* :-) we must have some critters inserting <cr>'s. I am talking
> about
[quoted text clipped - 4 lines]
>
> Running on AIX 5.2
Run
db2 -x "<query>" > <file>
and have a look at <file> with a hex-editor.

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
michael.bierenfeld@web.de - 30 Sep 2005 14:17 GMT
Munich .... Oktoberfest ...
Working the day after a couple of Wiesn Maß is not the best idea
Kind Regards
Michael