Inside the SRV_OPTION event handler

A client can request that an option be set or cleared, or that its current value be returned. Any of these commands triggers a SRV_OPTION event. Using the SRV_OPTION event handler, the application should:

  1. Call srv_options with the cmd argument set to CS_GET. The type of command the client issued (SRV_SETOPTION, SRV_CLEAROPTION, or SRV_GETOPTION) will be returned in optcmdp. The option itself will be returned in optionp. *bufp will contain all legal values associated with the option.

    For example, if the client has requested that Adaptive Server not report the number of rows affected by the query, optcmdp will contain SRV_SETOPTION, *optionp will contain CS_OPT_NOCOUNT, and *bufp will contain CS_TRUE.

  2. If optcmdp is either SRV_SETOPTION or SRV_CLEAROPTION, the application should clear or set the option accordingly in a standalone Open Server application. If the application is a gateway, it should send the appropriate client calls to manipulate the remote server’s option.

  3. If optcmdp is SRV_GETOPTION, the application should call srv_options with cmd set to CS_SET, optcmd set to SRV_SENDOPTION, optionp set to the option the client seeks the value of, and bufp set to the current value.