srv_xferdata

Description

Send parameters or data to a client, or receive parameters or data from a client.

Syntax

CS_RETCODE srv_xferdata(spp, cmd, type)
SRV_PROC         *spp;
CS_INT                cmd;
CS_INT               type;

Parameters

spp

A pointer to an internal thread control structure.

cmd

Indicates whether the data is going out to a client or coming in from a client. Table 3-152 describes the legal values for cmd:

Table 3-152:  Values for cmd (srv_xferdata)

Value

Description

CS_SET

The application is calling srv_xferdata to send data to a client.

CS_GET

The application is calling srv_xferdata to retrieve data from a client.

type

The type of data stored into or read from the program variable. Table 3-153 describes the valid types and their appropriate context:

Table 3-153:  Values for type (srv_xferdata)

Type

Valid cmd

Description of data

SRV_RPCDATA

CS_SET or CS_GET

RPC parameter

SRV_ROWDATA

CS_SET only

Result row column

SRV_CURDATA

CS_GET only

Cursor parameter

SRV_KEYDATA

CS_GET only

Cursor key column

SRV_ERRORDATA

CS_SET only

Error message parameter

SRV_DYNDATA

CS_SET or CS_GET

Dynamic SQL parameter

SRV_NEGDATA

CS_SET or CS_GET

Negotiated login parameter

SRV_MSGDATA

CS_SET or CS_GET

Message parameter

SRV_LANGDATA

CS_GET only

Language parameter

Returns

Table 3-154:  Return values (srv_xferdata)

Returns

To indicate

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

Examples

Example 1

#include   <ospublic.h>
/*
** Local Prototype.
*/
CS_RETCODE      ex_srv_xferdata PROTOTYPE((
SRV_PROC       *spp
));

/*
** EX_SRV_XFERDATA
**
**    This routine will send error message parameters to the
 **    specified client.
**    
**
** Arguments:
**
**    spp    A pointer to an internal thread control structure.
**
** Returns
**
**    CS_SUCCEED
**    CS_FAIL
**
*/
CS_RETCODE      ex_srv_xferdata(spp)
SRV_PROC        *spp;
{
    /* Check arguments.   */
    if(spp == (SRV_PROC *)NULL)
    {
        return(CS_FAIL);
    }
    return(srv_xferdata(spp,CS_SET,SRV_ERRORDATA));
}

Usage

See also

srv_bind, srv_descfmt