Fetches a specific row from the cursor associated with the statement handle.
This API can either fetch data into declared fields / data structures / arrays, or return data as primitive objects / arrays.
This API is only supported when using a IBM i database.
- Statement handle returned from pjs.allocStmt() or pjs.prepare(). The statement handle must be executed with pjs.execute() or pjs.executeDirect() before it can be used to fetch rows. This parameter is omitted if the API is called as a statement object method.
- The row number to fetch. The first row is considered row number 1.
- Following the optional field names, a Number can be passed that specifies the number of rows to fetch. Pass SQL_FETCH_ALL to fetch all rows. If not passed, 1 row will be fetched.
SQL diagnostics are reported in the SQLCA:
SQLCA fields are defined in Profound.js programs with the names in lowercase. sqlcode will be set to zero if execution was successful.
This API requires the Profound.js Connector module.