"Fabian Knopf" <F.*****@gmx.de> wrote in message news:<2t*************@uni-berlin.de>...
Hi @ll,
have some trouble on DB2 V8.1.
When i make a statement like this...
Update DocObj set pid=0 where pid is null.
I get a message that:
SQL0100W For Fech,UPDATE or DELETE there no rows available or the result of
the query is an emtpy table.
So , this is right my table is empty he makes everything correct but i dont
want this error message to appear. Because on every other Database i make
this command and dont get an error message how can i avoid this message?
Thx for reading and maybe answering.
Not exactly what you are looking for but, I use a filter to "swallow"
information that I dont want to see and replace it with a dot. That
way I get sort of a progressbar when running large scripts, and still
get any errors and warnings that I'm unaware about. Example:
db2 "Update DocObj set pid=0 where pid is null" | db2filter.py -i
SQL0100W
If you dont have python around, it should be simple to write something
similar in another scripting language.
> script
#!/usr/bin/python
import re
import sys
import getopt
def main():
ignore = [ "DB20000I" ]
try:
opts, args = getopt.getopt(sys.argv[1:], "i:")
except getopt.GetoptError:
print "Usage: xyz | db2filter.py [-i arg1,...,argn ]"
sys.exit(-1)
for o, a in opts:
if (o == "-i"):
args = a.split(',')
ignore += args
inf = sys.stdin
line = inf.read()
for a in ignore:
pattern = '[\S\s]*%s[\S\s]*' % a
if (re.match(pattern, line)):
sys.stdout.write('.')
sys.stdout.flush()
sys.exit(0)
print '\n' + line
if __name__ == "__main__":
main()
HTH
/Lennart
[...]