Statement's size limit is invalid

Error constant SQLE_INVALID_CURSOR_RANGE
ODBC 2 State 42000
ODBC 3 State 42000
Severity 15
SQLCODE –674
SQLSTATE 09W07
Sybase error code 13713
Probable cause

FIRST or TOP n are used in a SELECT statement to limit the size of a result. The size limit must be a constant integer greater than 0 and less than 32767.