srv_numparams

Description

Return the number of parameters contained in the current client command.

Syntax

CS_RETCODE srv_numparams(spp, numparamsp)
SRV_PROC    *spp;
CS_INT          *numparamsp;

Parameters

spp

A pointer to an internal thread control structure.

numparamsp

A pointer to the number of arguments in the current client command or cursor data stream is returned in *numparamsp.

Returns

Table 3-72: Return values (srv_numparams)

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_numparams PROTOTYPE((
SRV_PROC      *spp,
CS_INT        *countp 
));

/* 
** EX_SRV_NUMPARAMS
**
**    Example routine to illustrate the use of srv_numparams to
 **    get the number parameters contained in the current client
 **    command.
**
** Arguments:
**    spp    A pointer to an internal thread control structure.
**    countp A pointer to the buffer in which the number of
 **           parameters in the client command is returned.
**
** Returns:
**
**  CS_SUCCEED    The number of parameters was successfully 
 **                returned.
**  CS_FAIL       An error was detected.
*/
CS_RETCODE        ex_srv_numparams(spp, countp)
SRV_PROC          *spp;
CS_INT            *countp;
{
     if (srv_numparams(spp, countp) == CS_FAIL)
        return (CS_FAIL);

    return(CS_SUCCEED);
}

Usage

See also

srv_bind, srv_cursor_props, srv_descfmt, srv_dynamic, srv_msg, srv_xferdata, “Processing parameter and row data”