Bug #18594: DB2 Queries return zero rows
| From: | eableson at mac dot com | Date: | Fri, 26 Jul 2002 15:20:45 +0000 |
| Subject: | Bug #18594: DB2 Queries return zero rows | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-15349@lists.php.net to get a copy of this message | ||
From: eableson@mac.com
Operating system: Windows NT 4.0/W2K
PHP version: 4.2.2
PHP Bug Type: ODBC related
Bug description: DB2 Queries return zero rows
My script is making an ODBC connection to a remote DB2 database (I think
the host is an AS400). The data expected was the 34 row result noted
below, but it reports zero rows returned. The ODBC connection setup is
good as I have been able to receive the 34 row result into Excel. Further
testing of queries that should force a single row result (SELECT COUNT(*)
FROM RU99.RC545 WHERE SIGNONID='L6XJ') also returns zero rows.
Authentication is working correctly, and error handling is working
correctly - validated by trying with bad credentials and an invalid SQL
statement. It appears that the query is being issued properly since the
page load time is directly related to the complexity of the query issued.
Any help would be appreciated,
Erik Ableson
$dbconn = odbc_connect ( "DSN", "USER", "PASSWORD");
echo "Connected to: '$dbconn'<br>";
$sqlresult = odbc_exec( $dbconn, "SELECT * FROM RU99.RC548 WHERE
SIGNONID='L6XJ'");
echo "SQL Result: '" . $sqlresult . "'<BR>\n";
echo "Fields returned: " . odbc_num_fields($sqlresult) . "<BR>\n";
echo "Rows returned: " . odbc_num_rows ($sqlresult) . "<BR>\n";
With the following results:
Connected to: 'Resource id #1'
SQL Result: 'Resource id #2'
Fields returned: 6
Rows returned: 0
Actual output from DB2 client software:
SIGNONID NEW_VALUE
ATTR_NM
--------
--------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------
L6XJ L6XJ
userid
L6XJ 271941
unixid
L6XJ 84
unitnum
L6XJ ASSOCIATE
title
L6XJ 309-763-9022
telephonenumber
L6XJ Ableson
sn
L6XJ 20030710
reviewdate
L6XJ 20021008
reviewdate
L6XJ 30
recordtype
L6XJ 00
officenum
L6XJ OPR00A
ntdomain
L6XJ 001
notesserver
L6XJ TRUE
notesaccount
L6XJ MIKE WEER
managername
L6XJ AXM4
managerid
L6XJ Erik.Ableson.L6XJ@StateFarm.com
mail
L6XJ 100
locationnum
L6XJ CORPORATE SOUTH K2
location
L6XJ EXCH0001
hpnode
L6XJ Erik
givenname
L6XJ TRUE
exchangemail
L6XJ Associate
employeetype
L6XJ Erik.ABLESON
emc2name
L6XJ 00
dpoffice
L6XJ 9
divisionnum
L6XJ 99999
deptcat
L6XJ SYSTEMS
departmenttitle
L6XJ 1-00-984-100
departmentnumber
L6XJ 0
countrycode
L6XJ 1
companynum
L6XJ PSINET CONSULTING SOLUTIONS
companyname
L6XJ Erik Ableson
cn
L6XJ OPR95A
altntdomain
L6XJ DEV00A
altntdomain
34 record(s) selected.
db2 =>
--
Edit bug report at http://bugs.php.net/?id=18594&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18594&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18594&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18594&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18594&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18594&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18594&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18594&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18594&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18594&r=globals