Error opening cursor

Item Value
SQLCODE -171
Constant SQLE_OPEN_CURSOR_ERROR
SQLSTATE 07003
Sybase error code 102
ODBC 2 State 24000
ODBC 3 State 24000

Probable cause 

You attempted to open a cursor on a statement that is not a SELECT statement or a CALL or EXEC statement.