The following example selects reads records from a file table 50 rows at a time , into a primitive JavaScript object.:
Code Block | ||
---|---|---|
| ||
var c1 = pjs.allocStmt(); c1.executeDirect("SELECT prid, prname, prdesc FROM demolib/productsp ORDER BY prid"); if (SQLSTATE == '00000') { while (c1.hasMoreRows()) { var obj = c1.fetch(50); for (var i = 0; i < c1.rowCount(); i++) { console.log(obj[i]); } } } c1.close(); |