473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Suppress Wanring message

Hi,
When I run this query using WinSQL to connect to a DB2 database, it gave me
the warning:
Error: SQLSTATE 01003: Null values were eliminated from the argument of a
column function.

(State:01003, Native Code: 0)
Is there anyway to suppress this message in my report? Thanks
By the way, could anybody tell me some popular DB2 clients to make queries
Thanks
Nov 12 '05 #1
9 11994

"Doug Ly" <de******@dev.null> wrote in message
news:c8*****************@newssvr22.news.prodigy.co m...
Hi,
When I run this query using WinSQL to connect to a DB2 database, it gave me the warning:
Error: SQLSTATE 01003: Null values were eliminated from the argument of a
column function.

(State:01003, Native Code: 0)
Is there anyway to suppress this message in my report? Thanks
As far as I know, you can't suppress this message directly with a command
like "suppress null warning" or something like that. You can prevent the
message indirectly though.

This warning occurs because you applied a column function like avg() to a
numeric column, like salary, in an expression like 'avg(salary)', e.g.
select avg(salary) from employee. The column functions, which include avg(),
sum(), min(), and max() (and some others) are all designed to ignore nulls
because nulls added to, subtracted from, divided by or multiplied by another
value always equals null, e.g. 57 + null = null; 57 - null = null; 57 *
null; and 57/null = null. If the column function didn't ignore nulls, then
the result of the column function would always be null if there was any null
in the column, even if all but one of the values were non-null. Therefore
the average of a million test scores would be null, even if 999,999 of the
values were non-null.

To prevent the warning from occurring, you need to do one or both of these
things:
1. prevent any nulls from being evaluated by the column function
2. treat any null that is evaluated by the column function as if it were a
non-null value

To prevent nulls from being evaluated by a column function, use predicates
that screen out the null values, e.g. select avg(salary) from employee where
salary is not null. This is the advice that Mark A gave you in your earlier
post on this same subject.

To treat a null value as if it was a non-null value, such as zero, use the
coalesce() scalar function within your avg() function, e.g. select
avg(coalesce(salary, 0)) from employee. This will tell DB2 to treat every
null that the avg() function finds as if it were a zero.

Be cautious about the consequences of using the coalesce function! While it
should eliminate the warning message, it will also treat nulls as zeros and
you may not want that in every case. For example, if the column that you
average contains test scores, treating nulls as zeroes via the coalesce()
function will have the effect of skewing the average score downwards.
Consider two cases:

Case 1. Several students failed to write the exam because they are ill from
food poisoning and couldn't attend the exam.

Case 2. Several students were partying and failed to study; they wrote the
exam but got every question wrong.

I think most people would prefer to give the students in case 1 a test score
of null, to indicate that they hadn't written the exam, and EXCLUDE them in
the calculation of the class average. I think most people would prefer to
give the students in Case 2 a zero and INCLUDE their marks in the
calculation of the class average.

If you use coalesce() you will treat both Case 1 and Case 2 students as if
they were Case 2 students and ALL of them will be treated as if they got
zero on the exam; the Case 1 students will pull the class average further
down than it would have been if Case 1 students were simply ignored. If the
coalesce() function wasn't used and the warning was simply noted and
ignored, the class average would be calculated correctly and the Case 1
students would NOT pull the average down.

Now you can make an informed decision about which approach to use.

By the way, could anybody tell me some popular DB2 clients to make queries


You haven't said which platform you are on. QMF has been popular on MVS and
OS/390 for many years. There is a workstation version of QMF but I don't
recall which operating systems it works on. I'm sure there are many other
popular programs for writing queries against DB2 databases. You could even
write your own with languages like Java.

Rhino
Nov 12 '05 #2

"Doug Ly" <de******@dev.null> wrote in message
news:c8*****************@newssvr22.news.prodigy.co m...
Hi,
When I run this query using WinSQL to connect to a DB2 database, it gave me the warning:
Error: SQLSTATE 01003: Null values were eliminated from the argument of a
column function.

(State:01003, Native Code: 0)
Is there anyway to suppress this message in my report? Thanks
As far as I know, you can't suppress this message directly with a command
like "suppress null warning" or something like that. You can prevent the
message indirectly though.

This warning occurs because you applied a column function like avg() to a
numeric column, like salary, in an expression like 'avg(salary)', e.g.
select avg(salary) from employee. The column functions, which include avg(),
sum(), min(), and max() (and some others) are all designed to ignore nulls
because nulls added to, subtracted from, divided by or multiplied by another
value always equals null, e.g. 57 + null = null; 57 - null = null; 57 *
null; and 57/null = null. If the column function didn't ignore nulls, then
the result of the column function would always be null if there was any null
in the column, even if all but one of the values were non-null. Therefore
the average of a million test scores would be null, even if 999,999 of the
values were non-null.

To prevent the warning from occurring, you need to do one or both of these
things:
1. prevent any nulls from being evaluated by the column function
2. treat any null that is evaluated by the column function as if it were a
non-null value

To prevent nulls from being evaluated by a column function, use predicates
that screen out the null values, e.g. select avg(salary) from employee where
salary is not null. This is the advice that Mark A gave you in your earlier
post on this same subject.

To treat a null value as if it was a non-null value, such as zero, use the
coalesce() scalar function within your avg() function, e.g. select
avg(coalesce(salary, 0)) from employee. This will tell DB2 to treat every
null that the avg() function finds as if it were a zero.

Be cautious about the consequences of using the coalesce function! While it
should eliminate the warning message, it will also treat nulls as zeros and
you may not want that in every case. For example, if the column that you
average contains test scores, treating nulls as zeroes via the coalesce()
function will have the effect of skewing the average score downwards.
Consider two cases:

Case 1. Several students failed to write the exam because they are ill from
food poisoning and couldn't attend the exam.

Case 2. Several students were partying and failed to study; they wrote the
exam but got every question wrong.

I think most people would prefer to give the students in case 1 a test score
of null, to indicate that they hadn't written the exam, and EXCLUDE them in
the calculation of the class average. I think most people would prefer to
give the students in Case 2 a zero and INCLUDE their marks in the
calculation of the class average.

If you use coalesce() you will treat both Case 1 and Case 2 students as if
they were Case 2 students and ALL of them will be treated as if they got
zero on the exam; the Case 1 students will pull the class average further
down than it would have been if Case 1 students were simply ignored. If the
coalesce() function wasn't used and the warning was simply noted and
ignored, the class average would be calculated correctly and the Case 1
students would NOT pull the average down.

Now you can make an informed decision about which approach to use.

By the way, could anybody tell me some popular DB2 clients to make queries


You haven't said which platform you are on. QMF has been popular on MVS and
OS/390 for many years. There is a workstation version of QMF but I don't
recall which operating systems it works on. I'm sure there are many other
popular programs for writing queries against DB2 databases. You could even
write your own with languages like Java.

Rhino
Nov 12 '05 #3
In article <c8*****************@newssvr22.news.prodigy.com> , Doug Ly
(de******@dev.null) says...
Hi,
When I run this query using WinSQL to connect to a DB2 database, it gave me
the warning:
Error: SQLSTATE 01003: Null values were eliminated from the argument of a
column function.

(State:01003, Native Code: 0)
Is there anyway to suppress this message in my report? Thanks
By the way, could anybody tell me some popular DB2 clients to make queries
Thanks


You could try this (wrapped) command from the commandline:

update CLI CONFIGURATION FOR SECTION <DBNAME> using
IGNOREWARNLIST="'01003'"
To display the current settings:

db2 get CLI CONFIGURATION

Hope this helps
Nov 12 '05 #4
Man, what a detail help... I appreciate a lot.
I'm running Windows XP professional. And I'm using WinSQL to make SQL query.
But it is too limited. I've also tried the IBM DB2 client and it crashed
like hell.

Thanks
Nov 12 '05 #5

"Gert van der Kooij" <ge**@invalid.nl> wrote in message
news:MP************************@news.xs4all.nl...
In article <c8*****************@newssvr22.news.prodigy.com> , Doug Ly
(de******@dev.null) says...
Hi,
When I run this query using WinSQL to connect to a DB2 database, it gave me the warning:
Error: SQLSTATE 01003: Null values were eliminated from the argument of a column function.

(State:01003, Native Code: 0)
Is there anyway to suppress this message in my report? Thanks
By the way, could anybody tell me some popular DB2 clients to make queries Thanks


You could try this (wrapped) command from the commandline:

update CLI CONFIGURATION FOR SECTION <DBNAME> using
IGNOREWARNLIST="'01003'"

I wasn't aware of this command; I was obviously wrong when I said you can't
suppress the message.

Rhino
Nov 12 '05 #6
In article <bb*********************@news20.bellglobal.com>, Rhino
(rh****@NOSPAM.sympatico.ca) says...

You could try this (wrapped) command from the commandline:

update CLI CONFIGURATION FOR SECTION <DBNAME> using
IGNOREWARNLIST="'01003'"

I wasn't aware of this command; I was obviously wrong when I said you can't
suppress the message.


This command isn't going to work either, the '=' isn't supposed to be
there :)
Nov 12 '05 #7

"Doug Ly" <de******@dev.null> wrote in message
news:Ok*******************@newssvr22.news.prodigy. com...
Man, what a detail help... I appreciate a lot.
Sorry, I get a bit long-winded sometimes ;-) I'm glad my reply helped you
understand the situation.
I'm running Windows XP professional. And I'm using WinSQL to make SQL query. But it is too limited. I've also tried the IBM DB2 client and it crashed
like hell.
Which type of DB2 are you using? Personal Edition? Is your database also on
Windows XP or is your client on XP while your database is on Linux or
mainframe or some other platform?

Which version of DB2 are you using? V8.1 is the current version for Windows.

What DB2 client did you use? Do you mean the Command Center? What errors did
you get from your client? The Command Center usually works pretty well and
shouldn't break very often. Is it possible that you've made a mistake
installing it? It sounds like you are fairly new to DB2 and mistakes are
common for newbies. If you post as much information about your errors as
possible, people here can probably help you.

Your choice of a client really depends mostly on who is going to use the
client, what they're going to try to do with it, and how much money you're
willing to spend. You say the WinSQL is "too limited"; what is it not doing
that you need? That might give people an idea of what client will meet your
needs. But I'm not sure you really need another client; the stuff that comes
with DB2 is pretty good already.

Rhino

Thanks

Nov 12 '05 #8
Hi there (Rhino),

The DB2 database we're using right now is UDB V8.0 I believe. It resides
on an IBM RISC 6000 server. I mainly use Lotus Approach ( if you ever
heard of it :-) ) to make reports. Sometime it is very difficult to make
customized reports in Approach so I have to use winSQL which supports SQL
query language. Those kinds of reports normally require the grant total or
average or summary function, grouping, sorting that SQL query is the best
fit.

But when I go along with WinSQL, I know it only supports ODBC in general.
To get the full strength of DB2, I guess your suggestion of using the
IBM DB2 client is correct.
Now, I reckon there are 2 versions of DB2 clients posted on IBM website.
one says "UDB Personal Developer version" and the other one just says "UDB
client". I wonder which one should I pick to serve my purpose.

Thanks again!!!
Nov 12 '05 #9

"Doug L" <dm**@apollo.net> wrote in message
news:pa****************************@apollo.net...
Hi there (Rhino),

The DB2 database we're using right now is UDB V8.0 I believe. It resides
on an IBM RISC 6000 server. I mainly use Lotus Approach ( if you ever
heard of it :-) ) to make reports. Sometime it is very difficult to make
customized reports in Approach so I have to use winSQL which supports SQL
query language. Those kinds of reports normally require the grant total or
average or summary function, grouping, sorting that SQL query is the best
fit.
As it turns out, I *have* heard of Lotus Approach. In fact, I have it
(Release 9) on my computer. I have only used it a very few times though. I
just fired it up and it took me several minutes just to figure out how to
find a DB2 table with it because it had been so long since I last used it.

The Find/sort Assistant in Approach has a fair number of capabilities in
terms of 'WHERE' conditions and sorts but doesn't give you access to the DB2
column and scalar functions. However, I see from the Help that Approach has
many of its own functions that are similar to the DB2 functions. Some of the
Approach functions have the same names as their DB2 counterparts (e.g. Year,
Upper) and some have different names but similar funtionality (e.g.
Approach's combine() is similar to DB2's concat()). Then again, there are
some DB2 functions that don't appear to be in Approach at all (e.g.
Regression functions). Therefore, it may simply be a matter of getting more
familiar with Approach to do what you want to do.

I assume you're an end user of some kind, as opposed to a developer or DBA.
If that's right, is there any possibility of requesting an Approach course
from your training department? Or could you get someone there who is more
familiar with Approach to tutor you or at least answer your questions? If
not, maybe you could find an Approach tutorial somewhere online.

But when I go along with WinSQL, I know it only supports ODBC in general.
To get the full strength of DB2, I guess your suggestion of using the
IBM DB2 client is correct.
Now, I reckon there are 2 versions of DB2 clients posted on IBM website.
one says "UDB Personal Developer version" and the other one just says "UDB
client". I wonder which one should I pick to serve my purpose.
If you find that Approach simply won't do what you need to do, no matter how
fluent you are with it, then it's probably time to try the DB2 client.
Either of the ones you mentioned should work. You said before you were
having problems with the DB2 client so it might be wise to get one of your
DBAs to install it for you, just to make sure that a bad install doesn't
mess you up. Then, you'll need to sit down and learn how to use the Command
Center. Its design is different than Lotus Approach but it shouldn't be too
hard to learn if you get one of the DBAs to sit down with you for a half
hour and show you the basics of setting up your defaults (like the statement
delimiter), connecting to the database, and writing, saving and retrieving a
query. Then, use the SQL Getting Started and SQL Reference manuals that come
with DB2 and learn the elements of DB2 that you need to know.
Thanks again!!!


My pleasure. You obviously want to "expand your horizons" so that you can do
more with DB2 so I want you to get a start in the right direction.

Rhino
Nov 12 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Doug Ly | last post by:
Hi, When I run this query using WinSQL to connect to a DB2 database, it gave me the warning: Error: SQLSTATE 01003: Null values were eliminated from the argument of a column function. ...
1
by: Uttam | last post by:
Hello, How does one suppress the "Object already exists" message when the following statement is executed in ADO? cat.Views.Append "Some_Query", cmd Thanks in advance. Uttam
4
by: Robert | last post by:
Is there some way to suppress the automatic line feed in the detail section of a report in Access? I would like the detail to print out to the right of the existing one. The next line would be...
1
by: Dan | last post by:
In a VS.NET 2003 project automatically generating the XML documentation on build I have some .CS files which lack comments as they are automatically created by tools (such as strongly typed DataSet...
6
by: Ron St-Pierre | last post by:
Is there a way 'within' psql to suppress output? One of our cron scripts calls a sql file which contains various database commands (ALTER TABLEs, UPDATEs, etc) and various user-defined functions....
3
by: Eddy Ilg | last post by:
Hi, I would like to suppress .pyc generation or have the .pyc generation in a speical seperate root (I found something about PYCROOT). Has this been implemented yet? Is there an environment...
2
by: solar | last post by:
Is there any possibility to suppress a message box from Access ? I have a complicated but a good code that calculates the possibilities in the before update event, and if a condition is met, then...
1
by: jaishu | last post by:
When i try to insert data into a backend Oracle table (with ODBC) using a form, (i use docmd.runsql "insert....") Access gives me a message like"You are trying to append 1 row to the table are you...
2
by: ZeeHseez | last post by:
Hi, I have written a webbrowser application in VB .net Framework 1.1. I would like to suppress javascript error messages. However, the silent property of the webbrowser control suppresses the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.