[freetds] Set a warning on null values.

Frediano Ziglio freddy77 at gmail.com
Fri Jan 22 08:31:05 EST 2010


2010/1/21 Matt Piskorz <mpiskorz at hotmail.com>:
>
> Good day,
> I pinged the unixODBC list, but I was pointed to the freetds list.
> I'm connecting to MS Sql Server from Ubuntu using UnixODBC and freetds.  I'm having an issue with a query where I am getting back an extra record.
> Example:
> Rowset returned from sql client tool:RowID123
>
> Rowset returned from isql (unixodbc)RowID1233
> I receive this warning when I run the query in the ms sql client tool - "Warning: Null value is eliminated by an aggregate or other SET operation."If I run the query as is in unixodbc isql, then I get the 4th row.
> If I rewrite this query to remove the null, then I receive the correct recordset from the unixodbc isql tool.
> Question:  Is there a setting that I can set in the odbc.ini file (or someplace) that will return an error or a warning, instead of returning the 4th row? I'm an admin of a box, and I don't have full control over the queries that get and people are complaining the result sets are incorrect, when instead the query needs to be edited.
> If you want to reproduce the error, this is a sample set up that you can use:
> create table test(c1 int null, c2 int null) insert into test select 1,1 insert into test select 1,2 insert into test select 1,null
> Now run these from isql on ubuntu. select max(case when c1 = 1 then c2 end) from test  --this returns 2 rowsselect max(case when c1 = 1 then c2 end) from test where c2 is not null -- this returns 1 row
> Thanks for taking a look.Matt
>

I got 1 row using both select you posted.... Ubuntu 9.04 with unixODBC
and CVS HEAD.... which FreeTDS version are you using ?? I remember a
similar problem (many many time ago...)

bye
  freddy77



More information about the FreeTDS mailing list