
November 12th, 2005, 09:35 AM
| | | Statement Problem Update
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 | 
November 12th, 2005, 09:35 AM
| | | Re: Statement Problem Update
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 | 
November 12th, 2005, 09:35 AM
| | | Re: Statement Problem Update
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" <srielau@ca.ibm.com> schrieb im Newsbeitrag
news:2ts7gaF22d3aaU1@uni-berlin.de...[color=blue]
> 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[/color] | 
November 12th, 2005, 09:35 AM
| | | Re: Statement Problem Update
"Fabian Knopf" <F.Knopf@gmx.de> wrote in message
news:2tsbkuF23nl1lU1@uni-berlin.de...[color=blue]
> 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.
>[/color]
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 | 
November 12th, 2005, 09:35 AM
| | | Re: Statement Problem Update
Thx @ll !
SOLUTION:
in db2=>
UPDATE COMMAND OPTIONS USING W OFF
CU,
Fabian
"Rhino" <rhino1@NOSPAM.sympatico.ca> schrieb im Newsbeitrag
news:W87ed.58278$JG5.956563@news20.bellglobal.com. ..[color=blue]
>
> "Fabian Knopf" <F.Knopf@gmx.de> wrote in message
> news:2tsbkuF23nl1lU1@uni-berlin.de...[color=green]
> > 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.
> >[/color]
> Have a look at the 'w' option of the 'db2' command in the Command[/color]
Reference.[color=blue]
> According to the manual:
>
> Show Warning Messages Option (-w):
> The -w option tells the command line processor to show SQL statement[/color]
warning[color=blue]
> messages.
> The default setting for this command option is ON.
>
>
>
> Rhino
>
>[/color] | 
November 12th, 2005, 09:35 AM
| | | Re: Statement Problem Update
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:[color=blue]
> "Fabian Knopf" <F.Knopf@gmx.de> wrote in message
> news:2tsbkuF23nl1lU1@uni-berlin.de...
>[color=green]
>>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.
>>[/color]
>
> 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
>
>[/color] | 
November 12th, 2005, 09:35 AM
| | | Re: Statement Problem Update
"Fabian Knopf" <F.Knopf@gmx.de> wrote in message news:<2trugiF224uooU1@uni-berlin.de>...[color=blue]
> 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.[/color]
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.
[color=blue][color=green][color=darkred]
>>>>> script[/color][/color][/color]
#!/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
[...] | 
November 12th, 2005, 09:35 AM
| | | Re: Statement Problem Update
Serge Rielau <srielau@ca.ibm.com> wrote in message news:<2ts7gaF22d3aaU1@uni-berlin.de>...[color=blue]
> 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[/color]
db2 +o update ...... | 
November 12th, 2005, 09:36 AM
| | | Re: Statement Problem Update
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" <psherman@ameritech.net> schrieb im Newsbeitrag
news:e39ed.22557$Qv5.1839@newssvr33.news.prodigy.c om...[color=blue]
> 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:[color=green]
> > "Fabian Knopf" <F.Knopf@gmx.de> wrote in message
> > news:2tsbkuF23nl1lU1@uni-berlin.de...
> >[color=darkred]
> >>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.
> >>[/color]
> >
> > Have a look at the 'w' option of the 'db2' command in the Command[/color][/color]
Reference.[color=blue][color=green]
> > According to the manual:
> >
> > Show Warning Messages Option (-w):
> > The -w option tells the command line processor to show SQL statement[/color][/color]
warning[color=blue][color=green]
> > messages.
> > The default setting for this command option is ON.
> >
> >
> >
> > Rhino
> >
> >[/color]
>[/color] | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 205,248 network members.
|