Why am I getting “Data conversion or data mapping error. SQLCODE=-802” on a simple DB2 select statement?
问题 I am accessing DB2 information on an IBM i (AS400) with PHP. With this code: $query = "SELECT * FROM QS36F.MYTABLE WHERE MYFIELD=120006"; $result = db2_prepare($conn, $query); db2_execute($result); $i=0; while($row = db2_fetch_assoc($result) or die(db2_stmt_errormsg())){ $i++; print "Row " . $i . " successful<br />"; } I get: SELECT * FROM QS36F.MYTABLE WHERE MYFIELD=120006 Row 1 successful Row 2 successful Row 3 successful Row 4 successful Data conversion or data mapping error. SQLCODE=-802