dbTalk Databases Forums  

SUM(NULL) not work

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss SUM(NULL) not work in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Fantom
 
Posts: n/a

Default SUM(NULL) not work - 11-20-2007 , 07:22 AM






Hi
when i want set SUM(data) and data sometimes is NULL and this statement
return error (sqlcode = 109). Why this NULL <> 0 ?
In ASA8 this is work. Now i tested this on ASA 10.0.1.

Fantom
ps. SUM(ISNULL(data, 0)) is work OK, but i don't want change all statements
with agregate function in my aplication.



Reply With Quote
  #2  
Old   
Glenn Paulley
 
Posts: n/a

Default Re: SUM(NULL) not work - 11-20-2007 , 08:48 AM






SQLCODE 109 is merely a warning, not an error. The warning indicates
that at least one NULL value of column "data" was read from the table
and ignored in the computation of SUM.

This warning was also present in ASA 8 servers, but the ODBC interface
would fail to pass that warning back to the application properly. That
issue was fixed in a subsequent release.

Glenn

Fantom wrote:
Quote:
Hi
when i want set SUM(data) and data sometimes is NULL and this statement
return error (sqlcode = 109). Why this NULL <> 0 ?
In ASA8 this is work. Now i tested this on ASA 10.0.1.

Fantom
ps. SUM(ISNULL(data, 0)) is work OK, but i don't want change all statements
with agregate function in my aplication.


--
Glenn Paulley
Director, Engineering (Query Processing)
iAnywhere Solutions Engineering

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer


Reply With Quote
  #3  
Old   
Fantom
 
Posts: n/a

Default Re: SUM(NULL) not work - 11-20-2007 , 09:11 AM



Quote:
SQLCODE 109 is merely a warning, not an error. The warning indicates that
at least one NULL value of column "data" was read from the table and
ignored in the computation of SUM.

This warning was also present in ASA 8 servers, but the ODBC interface
I use ODBC and aplication hang up when this type of statement is runing.

Quote:
would fail to pass that warning back to the application properly. That
issue was fixed in a subsequent release.
Now i use the newest 10.0.1.3579 and aplication not work ok (borland with
ODBC and BDE) - no response and i must close aplication. In Sybase Central
10 i get warning on this statement.
When i run aplication on 8.0.3 this aplication work properly.

Fantom

Quote:
Glenn

Fantom wrote:
Hi
when i want set SUM(data) and data sometimes is NULL and this statement
return error (sqlcode = 109). Why this NULL <> 0 ?
In ASA8 this is work. Now i tested this on ASA 10.0.1.

Fantom
ps. SUM(ISNULL(data, 0)) is work OK, but i don't want change all
statements with agregate function in my aplication.

--
Glenn Paulley
Director, Engineering (Query Processing)
iAnywhere Solutions Engineering

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the
iAnywhere
Developer Community at www.ianywhere.com/developer



Reply With Quote
  #4  
Old   
Chris Keating (Sybase iAnywhere)
 
Posts: n/a

Default Re: SUM(NULL) not work - 11-20-2007 , 10:04 AM



I suspect that Delphi is not handling warnings as warnings.

To workaround this issue, you can suppress fetch warnings by checking
the appropriate option on the first tab of the ODBC DSN.

Fantom wrote:
Quote:
SQLCODE 109 is merely a warning, not an error. The warning indicates that
at least one NULL value of column "data" was read from the table and
ignored in the computation of SUM.

This warning was also present in ASA 8 servers, but the ODBC interface

I use ODBC and aplication hang up when this type of statement is runing.

would fail to pass that warning back to the application properly. That
issue was fixed in a subsequent release.

Now i use the newest 10.0.1.3579 and aplication not work ok (borland with
ODBC and BDE) - no response and i must close aplication. In Sybase Central
10 i get warning on this statement.
When i run aplication on 8.0.3 this aplication work properly.

Fantom

Glenn

Fantom wrote:
Hi
when i want set SUM(data) and data sometimes is NULL and this statement
return error (sqlcode = 109). Why this NULL <> 0 ?
In ASA8 this is work. Now i tested this on ASA 10.0.1.

Fantom
ps. SUM(ISNULL(data, 0)) is work OK, but i don't want change all
statements with agregate function in my aplication.
--
Glenn Paulley
Director, Engineering (Query Processing)
iAnywhere Solutions Engineering

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the
iAnywhere
Developer Community at www.ianywhere.com/developer



Reply With Quote
  #5  
Old   
Frank Vestjens
 
Posts: n/a

Default Re: SUM(NULL) not work - 11-20-2007 , 11:38 AM



Why not use SUM(IsNull(Data,0)) that solves all the problems and warnings.

Frank

Fantom wrote:
Quote:
SQLCODE 109 is merely a warning, not an error. The warning indicates that
at least one NULL value of column "data" was read from the table and
ignored in the computation of SUM.

This warning was also present in ASA 8 servers, but the ODBC interface


I use ODBC and aplication hang up when this type of statement is runing.


would fail to pass that warning back to the application properly. That
issue was fixed in a subsequent release.


Now i use the newest 10.0.1.3579 and aplication not work ok (borland with
ODBC and BDE) - no response and i must close aplication. In Sybase Central
10 i get warning on this statement.
When i run aplication on 8.0.3 this aplication work properly.

Fantom


Glenn

Fantom wrote:

Hi
when i want set SUM(data) and data sometimes is NULL and this statement
return error (sqlcode = 109). Why this NULL <> 0 ?
In ASA8 this is work. Now i tested this on ASA 10.0.1.

Fantom
ps. SUM(ISNULL(data, 0)) is work OK, but i don't want change all
statements with agregate function in my aplication.

--
Glenn Paulley
Director, Engineering (Query Processing)
iAnywhere Solutions Engineering

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the
iAnywhere
Developer Community at www.ianywhere.com/developer




Reply With Quote
  #6  
Old   
Fantom
 
Posts: n/a

Default Re: SUM(NULL) not work - 11-20-2007 , 12:20 PM



Quote:
Why not use SUM(IsNull(Data,0)) that solves all the problems and warnings.
I write in first post : i have thousends statement of this type.

Fantom

Quote:
Frank

Fantom wrote:
SQLCODE 109 is merely a warning, not an error. The warning indicates that
at least one NULL value of column "data" was read from the table and
ignored in the computation of SUM.

This warning was also present in ASA 8 servers, but the ODBC interface


I use ODBC and aplication hang up when this type of statement is runing.


would fail to pass that warning back to the application properly. That
issue was fixed in a subsequent release.


Now i use the newest 10.0.1.3579 and aplication not work ok (borland with
ODBC and BDE) - no response and i must close aplication. In Sybase
Central 10 i get warning on this statement.
When i run aplication on 8.0.3 this aplication work properly.

Fantom


Glenn

Fantom wrote:

Hi
when i want set SUM(data) and data sometimes is NULL and this statement
return error (sqlcode = 109). Why this NULL <> 0 ?
In ASA8 this is work. Now i tested this on ASA 10.0.1.

Fantom
ps. SUM(ISNULL(data, 0)) is work OK, but i don't want change all
statements with agregate function in my aplication.

--
Glenn Paulley
Director, Engineering (Query Processing)
iAnywhere Solutions Engineering

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the
iAnywhere
Developer Community at www.ianywhere.com/developer




Reply With Quote
  #7  
Old   
Fantom
 
Posts: n/a

Default Re: SUM(NULL) not work - 11-20-2007 , 12:21 PM



Quote:
I suspect that Delphi is not handling warnings as warnings.

To workaround this issue, you can suppress fetch warnings by checking the
appropriate option on the first tab of the ODBC DSN.
I know. I always check this option (Delphi).

Fantom

Quote:
Fantom wrote:
SQLCODE 109 is merely a warning, not an error. The warning indicates
that at least one NULL value of column "data" was read from the table
and ignored in the computation of SUM.

This warning was also present in ASA 8 servers, but the ODBC interface

I use ODBC and aplication hang up when this type of statement is runing.

would fail to pass that warning back to the application properly. That
issue was fixed in a subsequent release.

Now i use the newest 10.0.1.3579 and aplication not work ok (borland with
ODBC and BDE) - no response and i must close aplication. In Sybase
Central 10 i get warning on this statement.
When i run aplication on 8.0.3 this aplication work properly.

Fantom

Glenn

Fantom wrote:
Hi
when i want set SUM(data) and data sometimes is NULL and this statement
return error (sqlcode = 109). Why this NULL <> 0 ?
In ASA8 this is work. Now i tested this on ASA 10.0.1.

Fantom
ps. SUM(ISNULL(data, 0)) is work OK, but i don't want change all
statements with agregate function in my aplication.
--
Glenn Paulley
Director, Engineering (Query Processing)
iAnywhere Solutions Engineering

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the
iAnywhere
Developer Community at www.ianywhere.com/developer



Reply With Quote
  #8  
Old   
Frank Vestjens
 
Posts: n/a

Default Re: SUM(NULL) not work - 11-20-2007 , 12:29 PM



You're right. I should have read better.

You wrote: Why this NULL <> 0?

Null means the fields is undefined and has no value. '0' mean it has a
value of '0'.

You could add default values to the fields in the database for the
fields having this problem. That will also solve it.

Frank

Fantom wrote:
Quote:
Why not use SUM(IsNull(Data,0)) that solves all the problems and warnings.


I write in first post : i have thousends statement of this type.

Fantom


Frank

Fantom wrote:

SQLCODE 109 is merely a warning, not an error. The warning indicates that
at least one NULL value of column "data" was read from the table and
ignored in the computation of SUM.

This warning was also present in ASA 8 servers, but the ODBC interface


I use ODBC and aplication hang up when this type of statement is runing.



would fail to pass that warning back to the application properly. That
issue was fixed in a subsequent release.


Now i use the newest 10.0.1.3579 and aplication not work ok (borland with
ODBC and BDE) - no response and i must close aplication. In Sybase
Central 10 i get warning on this statement.
When i run aplication on 8.0.3 this aplication work properly.

Fantom



Glenn

Fantom wrote:


Hi
when i want set SUM(data) and data sometimes is NULL and this statement
return error (sqlcode = 109). Why this NULL <> 0 ?
In ASA8 this is work. Now i tested this on ASA 10.0.1.

Fantom
ps. SUM(ISNULL(data, 0)) is work OK, but i don't want change all
statements with agregate function in my aplication.

--
Glenn Paulley
Director, Engineering (Query Processing)
iAnywhere Solutions Engineering

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the
iAnywhere
Developer Community at www.ianywhere.com/developer




Reply With Quote
  #9  
Old   
Fantom
 
Posts: n/a

Default Re: SUM(NULL) not work - 11-20-2007 , 01:16 PM



Quote:
You're right. I should have read better.

You wrote: Why this NULL <> 0?

Null means the fields is undefined and has no value. '0' mean it has a
value of '0'.

You could add default values to the fields in the database for the fields
having this problem. That will also solve it.
But in ASA8 when i sum (1+null+2+3) i get 6.
When i convert database to 10 i have big problem, because my aplication is
hung up when in SUM exists NULL.

Fantom

Quote:
Frank

Fantom wrote:
Why not use SUM(IsNull(Data,0)) that solves all the problems and
warnings.


I write in first post : i have thousends statement of this type.

Fantom


Frank

Fantom wrote:

SQLCODE 109 is merely a warning, not an error. The warning indicates
that at least one NULL value of column "data" was read from the table
and ignored in the computation of SUM.

This warning was also present in ASA 8 servers, but the ODBC interface


I use ODBC and aplication hang up when this type of statement is runing.



would fail to pass that warning back to the application properly. That
issue was fixed in a subsequent release.


Now i use the newest 10.0.1.3579 and aplication not work ok (borland
with ODBC and BDE) - no response and i must close aplication. In Sybase
Central 10 i get warning on this statement.
When i run aplication on 8.0.3 this aplication work properly.

Fantom



Glenn

Fantom wrote:


Hi
when i want set SUM(data) and data sometimes is NULL and this
statement return error (sqlcode = 109). Why this NULL <> 0 ?
In ASA8 this is work. Now i tested this on ASA 10.0.1.

Fantom
ps. SUM(ISNULL(data, 0)) is work OK, but i don't want change all
statements with agregate function in my aplication.

--
Glenn Paulley
Director, Engineering (Query Processing)
iAnywhere Solutions Engineering

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the
iAnywhere
Developer Community at www.ianywhere.com/developer






Reply With Quote
  #10  
Old   
Dmitri
 
Posts: n/a

Default Re: SUM(NULL) not work - 11-21-2007 , 01:46 AM



"Fantom" <szczukot (AT) poczta (DOT) onet.pl.skasujto>

Quote:
But in ASA8 when i sum (1+null+2+3) i get 6.
When i convert database to 10 i have big problem, because my aplication is
hung up when in SUM exists NULL.
Your application is coded to the bug and needs to be fixed. Asking SA
developers to code around bugs in the ancient crap (BDE) is not reasonable.

Dmitri.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.