freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
[freetds] Warning: Null value is eliminated by an aggregate or other SET operation.
- From: Jeff Dahl <jddahl AT micron.com>
- To: freetds AT lists.ibiblio.org
- Subject: [freetds] Warning: Null value is eliminated by an aggregate or other SET operation.
- Date: Fri, 24 Mar 2006 17:29:21 -0700
Table:
name varchar(20) | value int
===================|==========
a | null
Query:
select sum(value) from Table
Why does the following code print out the last row twice. Once with 'ret == SQL_SUCCESS' and once when 'ret == SQL_SUCCESS_WITH_INFO'?
while(( ret = SQLFetch( cmd )) != SQL_NO_DATA )
{
if( ret == SQL_SUCCESS_WITH_INFO )
{
// print warning
}
else if( ret == SQL_ERROR )
{
// print error
}
// print row
}
If I wrap the print in an else, I only get one row:
while(( ret = SQLFetch( cmd )) != SQL_NO_DATA )
{
if( ret == SQL_SUCCESS_WITH_INFO )
{
// print warning
}
else if( ret == SQL_ERROR )
{
// print error
}
*else*
{
// print row
}
}
It appears that when SQLFetch returns with SQL_SUCCESS_WITH_INFO, another row is appended with the same data and a return status of SQL_SUCCESS. Is this standard behavior? Should two rows be returned with different SQLSTATEs?
Thanks,
Jeff Dahl
- [freetds] Warning: Null value is eliminated by an aggregate or other SET operation., Jeff Dahl, 03/24/2006
Archive powered by MHonArc 2.6.24.