Associate browse mode result columns with result tables.
CS_RETCODE srv_tabcolname(spp, colnum, brwsdescp)
SRV_PROC *spp; CS_INT colnum; CS_BROWSEDESC *brwsdescp;
A pointer to an internal thread control structure.
The number used to identify the column that was previously described using srv_desc&fmt.
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 |
To indicate |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
#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);
}
srv_tabcolname is used to send browse mode result information to a client. The information an application can send includes:
The name of the table to which a result column maps
The real name of a column that was renamed in the client query’s select statement
The column must have previously been defined using srv_desc&fmt.
The table must have previously been defined using srv_tabname.
srv_tabcolname is called once for each result column that is a column in a result row.