Re: Set a warning on null values.
Armando Ortiz <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Organization | CPP Corporation |
| Message-ID | <[email protected]> |
Try running: tsql -C On Friday 22 January 2010 07:59:44 am Matt Piskorz wrote: > Lets see.... > Ubuntu is 8.04. Whats the easiest way to find the version of FreeTDS? > > > Date: Fri, 22 Jan 2010 14:31:05 +0100 > > From: [email protected] > > To: [email protected] > > Subject: Re: [freetds] Set a warning on null values. > > > > 2010/1/21 Matt Piskorz <[email protected]>: > > > 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 > > _______________________________________________ > > FreeTDS mailing list > > [email protected] > > http://lists.ibiblio.org/mailman/listinfo/freetds > > _________________________________________________________________ > Hotmail: Powerful Free email with security by Microsoft. > http://clk.atdmt.com/GBL/go/196390710/direct/01/ > _______________________________________________ > FreeTDS mailing list > [email protected] > http://lists.ibiblio.org/mailman/listinfo/freetds >