srv_tabcolname

Description

Associate browse mode result columns with result tables.

Syntax

CS_RETCODE srv_tabcolname(spp, colnum, brwsdescp)
SRV_PROC                *spp;
CS_INT                        colnum;
CS_BROWSEDESC    *brwsdescp;

Parameters

spp

A pointer to an internal thread control structure.

colnum

The number used to identify the column that was previously described using srv_descfmt.

brwsdescp

A pointer to a structure containing browse information about the column in question. Specifically, it should contain the number of the table (previously described through srv_tabname) containing the column and the original column name and name length. Note that the original column name and name length are only needed if the column has been renamed in the select statement (indicated by a status of CS_RENAMED in the CS_BROWSEDESC structure). For more information on the CS_BROWSEDESC structure, see “CS_BROWSEDESC structure”.

Returns

Table 3-137: Return values (srv_tabcolname)

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_tabcolname PROTOTYPE((
SRV_PROC           *spp,
CS_INT             colnum,
CS_BROWSEDESC      *bdp
));

/*
** EX_SRV_TABCOLNAME
**
**    Example routine to associate a browse mode result column
 **    with result tables.
**
** Arguments:
**    spp      A pointer to an internal thread control structure.
**
**    colnum   The column number.
**
**    bdp      A pointer to the browse descriptor for the
 **             column.
**
** Returns:
**     CS_SUCCEED   If we successfully associated this result
 **                  column with its table.
**
**     CS_FAIL      If an error was detected.
**
*/
CS_RETCODE          ex_srv_tabcolname(spp, colnum, bdp)
SRV_PROC           *spp;
CS_INT             colnum;
CS_BROWSEDESC      *bdp;
{
     CS_RETCODE         result;

     result = srv_tabcolname(spp, colnum, bdp);

     return (result);
}

Usage

See also

srv_descfmt, srv_tabname, “Browse mode”