Re: Set a warning on null values.
Matt Piskorz <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
Hmmmm.... so comparing your output with mine, I get some interesting results. Thank you for pointing me in the tsql -C direction. Compile-time settings (established with the "configure" script) Version: freetds v0.82 freetds.conf directory: /usr/local/etc MS db-lib source compatibility: no Sybase binary compatibility: no Thread safety: yes iconv library: yes TDS version: 5.0 iODBC: no unixodbc: no So... This is my freetds.conf file.[Server] host = server.com port = 1433 tds version = 8.0 client charset = UTF-8 Also, the freetds.conf I have been editing is /etc/freetds/freetds.conf. But, from the output above, it looks like I should be looking at /usr/local/etc. I added the above config for "SERVER" to that file as well, but it did not change the output. Clearly, there is something else I am missing. The first question I have is if tsql -C reports TDS version as 5.0, how do I get this to use the 8.0 version that I specified in the freetds.conf file? > From: [email protected] > To: [email protected] > Subject: Re: [freetds] Set a warning on null values. > Date: Fri, 22 Jan 2010 14:21:18 -0800 > > I put this in the list as well. Try this: > > tsql -C > > You should get output like this: > > Compile-time settings (established with the "configure" script): > Version: freetds v0.64 > MS db-lib source compatibility: no > Sybase binary compatibility: unknown > Thread safety: yes > iconv library: yes > TDS version: 7.0 > iODBC: no > unixodbc: yes > > 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 > > _________________________________________________________________ Hotmail: Trusted email with powerful SPAM protection. http://clk.atdmt.com/GBL/go/196390707/direct/01/