When using the SQL_MoveFirsB, SQL_MoveNextB, SQL_MoveLastB, and SQL_MovePrevB functions, the returned value *ERROR* usually means end-of-file (EOF). However, it is possible for other errors to occur. For a consistent check for EOF, use the SQL_LastFullErr function.
To check for end-of-file (EOF):
- Connect to the RPG2SQL PC Component.
- Receive a socket in variable SQL_Socket.
- Retrieved the record into the variable rtnRecord.
- Use the following code to check for EOF:
// If error indicated, see if it's BOF/EOF
if rtnRecord = '*ERROR*';
errMsg = SQL_LastFullErr(stateDS.socketSel);
if (errMsg = '-1 End of file reached.' or
errmsg = '-2 Beginning of file reached.');
pEof = *on;
Last Modified On:
No, open a new Support Case
You don't have the appropriate permissions.