Illegal cursor operation attempt

Item Value
SQLCODE -187
Constant SQLE_CURSOROP_NOT_ALLOWED
SQLSTATE 09W02
Sybase error code 9526
ODBC 2 State 07005
ODBC 3 State 07005

Probable cause 

You attempted an illegal cursor operation. For example, you may be attempting to OPEN a cursor for a statement that is neither a SELECT nor a BATCH.