|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-23 13:57 UTC] denials at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 02:00:01 2025 UTC |
Description: ------------ Note: DB2 is version 8 FP10. Calling a column function like COUNT() using 'ibm_db2' fails if there are NULLs in the column. See the repro code below. It works fine with ODBC. This is a simplified repro scenario from a large application I'm porting. In that application, db2_stmt_error() and db2_stmt_errormsg() return more info, but for some reason they don't seem to be working in my simple script. Reproduce code: --------------- DDL: create table mytable (col1 int); insert into mytable values (1); insert into mytable values (2); insert into mytable values (NULL); insert into mytable values (4); PHP app: $statement = "SELECT count(col1) FROM mytable"; $result = db2_exec($dbconn, $statement); if (db2_stmt_error()) { printf("%s\n", db2_stmt_errormsg()); } while ($row = db2_fetch_array($result)) { printf ("\"%s\"\n", $row[0]); } Expected result: ---------------- "3" Actual result: -------------- PHP Warning: db2_fetch_array(): Fetch Failure in C:\MyServer\testDb2Api.php on line 85 Warning: db2_fetch_array(): Fetch Failure in C:\MyServer\testDb2Api.php on line 85 In my large app, db2_stmt_errormsg() returns: [IBM][CLI Driver][DB2/NT] SQLSTATE 01003: Null values were eliminated from the argument of a column function.