Skip to Content.
Sympa Menu

freetds - Re: [freetds] problems using freetds with php & unixodbc

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] problems using freetds with php & unixodbc
  • Date: Wed, 9 Oct 2013 20:02:18 -0400

On Wed, 09 Oct 2013 10:56:09 +0200
Axel Westhagen <axel.westhagen AT limbas.com> wrote:

> I add two trace files with the same statement execute from php and
> from isql. They are different. iodbc use sqlPrepare.

I suspect a NULL-handling error either in PHP or in your application.
SQL Server returns a row for SUM even if there are no rows, see below.

> It seems there is a Problem at "Null value is eliminated by an
> aggregate or other SET operation" ?

That is not an error; it's a message from the server warning you that
the SUM function ignored NULLs in at least one row included in the
aggregation. The message is dictated by the ANSI standard. It can be
suppressed using SET, but the effect is the same whether or not the
message is produced.

Here's a simple example:

$ printf 'create table nt(t int null)\ngo\n insert nt values (NULL)
select sum(t) from nt\ngo\n drop table nt\ngo\n' | bsqlodbc ....
----------
NULL
bsqlodbc: error 8153: 01003: [FreeTDS][SQL Server]Warning: Null value
is eliminated by an aggregate or other SET operation.

If you use TDSDUMP I'm sure you'll see the row sent from the server and
produced by the ODBC function that PHP calls. The problem you're
experiencing appears to be further up the stack.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page