I am accessing DB2 information about 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
Line 2 successfully
Line 3 successfully
Line 4 successfully
Data conversion or data mapping error. SQLCODE = -802
There must be more than 4 results. Why can this error occur?
More details:
- The same error occurs for any value that I look for in MYFIELD, although it may be after a different number of successful results.
- MYFIELD NUMERIC (7.0)
- I can search for other fields in the table (including numeric) and it works fine.
source share