Re: problems using freetds with php & unixodbc
"James K. Lowden" <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 09 Oct 2013 10:56:09 +0200 Axel Westhagen <[email protected]> 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