[unixODBC-support] UnixODBC and ansi warnings
mpiskorz at hotmail.com
Thu Jan 21 16:33:30 GMT 2010
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.
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 rows
select 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
Hotmail: Trusted email with powerful SPAM protection.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the unixODBC-support