By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,454 Members | 1,804 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,454 IT Pros & Developers. It's quick & easy.

Statement Problem Update

P: n/a
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.

Cu,

Fabian
Nov 12 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Fabian,

It's a warning not an error.
If you expect the table to be empty you can simply ignore it.
If you happen to use the command line there may (I didn't check!) be an
option to absorb warnings. Check the common reference manual.

Cheers
Serge
Nov 12 '05 #2

P: n/a
Hi Serge,

i didnt find any parameter to avoid this warning.
It would be very nice if you can find it. Sry but i dont find it.

cu,

Fabian

"Serge Rielau" <sr*****@ca.ibm.com> schrieb im Newsbeitrag
news:2t*************@uni-berlin.de...
Fabian,

It's a warning not an error.
If you expect the table to be empty you can simply ignore it.
If you happen to use the command line there may (I didn't check!) be an
option to absorb warnings. Check the common reference manual.

Cheers
Serge

Nov 12 '05 #3

P: n/a

"Fabian Knopf" <F.*****@gmx.de> wrote in message
news:2t*************@uni-berlin.de...
Hi Serge,

i didnt find any parameter to avoid this warning.
It would be very nice if you can find it. Sry but i dont find it.

Have a look at the 'w' option of the 'db2' command in the Command Reference.
According to the manual:

Show Warning Messages Option (-w):
The -w option tells the command line processor to show SQL statement warning
messages.
The default setting for this command option is ON.

Rhino
Nov 12 '05 #4

P: n/a
Thx @ll !

SOLUTION:
in db2=>

UPDATE COMMAND OPTIONS USING W OFF

CU,

Fabian
"Rhino" <rh****@NOSPAM.sympatico.ca> schrieb im Newsbeitrag
news:W8********************@news20.bellglobal.com. ..

"Fabian Knopf" <F.*****@gmx.de> wrote in message
news:2t*************@uni-berlin.de...
Hi Serge,

i didnt find any parameter to avoid this warning.
It would be very nice if you can find it. Sry but i dont find it.
Have a look at the 'w' option of the 'db2' command in the Command

Reference. According to the manual:

Show Warning Messages Option (-w):
The -w option tells the command line processor to show SQL statement warning messages.
The default setting for this command option is ON.

Rhino

Nov 12 '05 #5

P: n/a
This option (-w) didn't suppress the message on my 8.2 (8.1 + FP7a)
RHEL3 system. The option is displayed when I try: db2 ? options.

I don't think -w effects this particular message. Maybe it should?

Phil Sherman
Rhino wrote:
"Fabian Knopf" <F.*****@gmx.de> wrote in message
news:2t*************@uni-berlin.de...
Hi Serge,

i didnt find any parameter to avoid this warning.
It would be very nice if you can find it. Sry but i dont find it.


Have a look at the 'w' option of the 'db2' command in the Command Reference.
According to the manual:

Show Warning Messages Option (-w):
The -w option tells the command line processor to show SQL statement warning
messages.
The default setting for this command option is ON.

Rhino


Nov 12 '05 #6

P: n/a
"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

[...]
Nov 12 '05 #7

P: n/a
JS
Serge Rielau <sr*****@ca.ibm.com> wrote in message news:<2t*************@uni-berlin.de>...
Fabian,

It's a warning not an error.
If you expect the table to be empty you can simply ignore it.
If you happen to use the command line there may (I didn't check!) be an
option to absorb warnings. Check the common reference manual.

Cheers
Serge

db2 +o update ......
Nov 12 '05 #8

P: n/a
It worked not !!!
I thought but i was to fast.
It's not working with -w .
Have anybody a new idea for this problem.
I dont want to write a wrapper or i dont want to fix all my SQL Statements.
Because i use standard SQL if DB2 cant avoid this i will kick this shit
Database and will buy a new License for Microsoft SQL Server.
Is DB2 so shitty ???

Cu,

Fabian
"Philip Sherman" <ps******@ameritech.net> schrieb im Newsbeitrag
news:e3******************@newssvr33.news.prodigy.c om...
This option (-w) didn't suppress the message on my 8.2 (8.1 + FP7a)
RHEL3 system. The option is displayed when I try: db2 ? options.

I don't think -w effects this particular message. Maybe it should?

Phil Sherman
Rhino wrote:
"Fabian Knopf" <F.*****@gmx.de> wrote in message
news:2t*************@uni-berlin.de...
Hi Serge,

i didnt find any parameter to avoid this warning.
It would be very nice if you can find it. Sry but i dont find it.


Have a look at the 'w' option of the 'db2' command in the Command Reference. According to the manual:

Show Warning Messages Option (-w):
The -w option tells the command line processor to show SQL statement warning messages.
The default setting for this command option is ON.

Rhino

Nov 12 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.