Handling cursor requests

An Open Server application uses a SRV_CURSOR event handler to handle cursor requests. The handler includes code to detect which of the cursor commands has been issued and to respond with the appropriate information.

The event handler first determines the current cursor and the cursor command that triggered the SRV_CURSOR event by calling srv_cursor_props with the cmd argument set to CS_GET. Open Server then fills the curcmd field of the Open Server application’s SRV_CURDESC structure with the command type.

The application can then determine what other information it needs to retrieve, if any, as well as what data to send back to the client. In some cases, it may need to retrieve parameter formats and parameters; in others, it may want to ascertain the status of the current cursor and the number of rows to fetch. In some cases, it may only need to send back a CS_CURSOR_INFO command; in others, it may need to send back result data or return parameters.