srv_tabname

Description

Provide the name of the table or tables associated with a set of browse mode results.

Syntax

CS_RETCODE srv_tabname(spp, tablenum, tablenamep,
                  namelen)
SRV_PROC       *spp;
CS_INT              tablenum;
CS_CHAR         *tablenamep;
CS_INT             namelen;

Parameters

spp

A pointer to an internal thread control structure.

tablenum

The number used to identify the table in subsequent calls to srv_tabcolname.

tablenamep

A pointer to the name of the table. It cannot be null, as tables always have names.

namelen

The length, in bytes, of the table name. If namelen is CS_NULLTERM, then Server Library expects the table name to be null terminated.

Returns

Table 3-138:  Return values (srv_tabname)

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_tabname PROTOTYPE((
SRV_PROC        *sproc,
CS_INT          tablenum,
CS_CHAR         *tablename
));

/*

** EX_SRV_TABNAME
**    An example routine to provide the name of the table
 **    associated with a set of browse mode results.
**
** Arguments:
**    sproc         A pointer to an internal thread control
 **                  structure.
**    tablenum      The number that will be used to identify
 **                  the table in subsequent calls to

 **                  srv_tabcolname.
**    tablename     A null terminated string specifying the
 **                  table name.
**
** Returns:
**    CS_SUCCEED   If the table is successfully described.
**    CS_FAIL      If an error was detected.
*/
CS_RETCODE         ex_srv_tabname(sproc, tablenum, tablename)
SRV_PROC           *sproc;
CS_INT             tablenum;
CS_CHAR            *tablename;
{
     return( srv_tabname(sproc, tablenum, tablename,
                CS_NULLTERM) );
}

Usage

See also

srv_descfmt, srv_tabcolname, “Browse mode”