Use Client-Library cursors when you want to process two or more commands at the same time while using only one server connection.
A Client-Library cursor-open command is the only command type that allows the application to send new commands over the same connection while still retrieving rows. After sending any other type of command, your application must completely process the results of the command before another command can be sent on the same connection. If the application design requires this functionality, then there is no alternative to using Client-Library cursor commands. See “Benefits of Client-Library cursors” and “Connection and command rules”.
Note that cursors can only be declared to execute a single select statement. See “Step 1: Declare the cursor”.