srv_senddone

Sends a results completion message to the client.

Syntax

int srv_senddone (
SRV_PROC *
srvproc,
DBUSMALLINT
status,
DBUSMALLINT
info,
DBINT
count );

where

srvproc
Is a pointer to the SRV_PROC structure that is the handle for a particular client connection (in this case, the handle that received the language request). The structure contains the information that the ODS Library uses to manage communication and data between the Open Data Services server application and the client.
status
Is a 2-byte bit field for various status flags. Multiple flags can be set by using the AND and OR operators with status flag values. Here is a list of the possible status flags:
Status Description
SRV_DONE_FINAL The current set of results is the final set of results.
SRV_DONE_MORE The current set of results isn't the final set of results.
SRV_DONE_COUNT The count parameter contains a valid count.
SRV_DONE_ERROR The current client command received an error.
SRV_DONE_RPC_IN_BATCH The current set of results is the last set of the currently executing remote stored procedure. This value is used when multiple remote stored procedures are executed in a single batch.

info
Is a reserved, 2-byte field. Set this value to 0.
count
Is a 4-byte field used to indicate a count for the current results set. If the SRV_DONE_COUNT flag is set in the status field, count holds a valid count.

Returns

SUCCEED or FAIL.

Remarks

A client request can cause the server to execute a number of commands and to return a number of results sets. For each results set, srv_senddone must return a results completion message to the client.

To indicate that there are more results for the current request, the Open Data Services server application must set the status field to SRV_DONE_MORE. To indicate that there are no more results for the current request, the Open Data Services server application must set the status field to SRV_DONE_FINAL. However, when an application function is installed as a SQL Server extended stored procedure instead of as a separate Open Data Services server application, use SRV_DONE_MORE. With extended stored procedures, SQL Server itself sends SRV_DONE_FINAL.

The count field indicates the number of rows affected by a command. If the count field contains a count, the SRV_DONE_COUNT bit should be set in the status field. This setting allows the client to distinguish between a count of 0 and an unused count field.

Do not call srv_senddone from the SRV_CONNECT handler.

See Also

This entry For information about
srv_sendmsg Sending a message to the client
srv_sendrow Sending a row to the client
srv_sendstatus Sending a status value to the client