Send a compute row to a client.
CS_RETCODE srv_alt_xferdata(spp, altid)
SRV_PROC *spp;
CS_INT altid;
A pointer to an internal thread control structure.
The unique identifier for the compute row being sent to the client. The altid is defined using srv_alt_header.
Returns |
To indicate |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
#include <ospublic.h>
/*
** Local Prototype.
*/
CS_RETCODE ex_srv_alt_xferdata PROTOTYPE((
SRV_PROC *spp,
CS_INT altid
));
/*
** EX_SRV_ALTXFERDATA
**
** Example routine to send a compute row the the client using
** srv_altxferdata.
**
** Arguments:
** spp A pointer to an internal thread control structure.
** altid The compute row identifier (defined using
** srv_alt_header).
**
** Returns:
**
** CS_SUCCEED The row was sent to the client.
** CS_FAIL An error was detected.
*/
CS_RETCODE ex_srv_alt_xferdata(spp, altid)
SRV_PROC *spp;
CS_INT altid;
{
/*
** Send the compute row to the client.
*/
if (srv_alt_xferdata(spp, altid) != CS_SUCCEED)
{
return (CS_FAIL);
}
return (CS_SUCCEED);
}
Only applications that mimic Adaptive Server Enterprise’s feature of returning compute row information will need to call srv_alt_xferdata. It is most useful to applications acting as a gateway to an Adaptive Server Enterprise.
srv_alt_xferdata sends a compute row to the client. It is called once for each altid.
To process compute row data, an Open Server application must:
Call srv_alt_header to define a compute row identifier.
Call srv_alt_descfmt for each column to describe the format the column data is in when the client receives it.
Call srv_alt_bind for each column to bind the data to a local program variable.
Call srv_alt_xferdata to send the row to the client, once each column in the compute row has been described and its data bound to a program variable.
All compute rows must be sent to the client before sending the completion status with srv_senddone.