Define the user datatype to be associated with a column.
CS_RETCODE srv_setcolutype(spp, column,utype)
SRV_PROC *spp; CS_INT column; CS_INT utype;
A pointer to an internal thread control structure.
The column number of the column with which to associate the user datatype. The first column is 1.
The user-defined datatype to be associated with the column.
Returns |
To indicate |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
#include <ospublic.h>
/*
** Local Prototype.
*/
CS_RETCODE ex_srv_setcolutype PROTOTYPE((
SRV_PROC *spp,
CS_INT column,
CS_INT utype
));
/*
** EX_SRV_SETCOLUTYPE
**
** Example routine to define the user datatype to be associated
** with a column using srv_setcolutype.
**
** Arguments:
** spp A pointer to an internal thread control structure.
** column The column number associated with the type.
** utype The type to be associated with the column.
**
** Returns:
**
** CS_SUCCEED The datatype was successfully associated with
** the column.
** CS_FAIL An error was detected.
*/
CS_RETCODE ex_srv_setcolutype(spp, column, utype)
SRV_PROC *spp;
CS_INT column;
CS_INT utype;
{
/*
** Associate the type with the column.
*/
if (srv_setcolutype(spp, column, utype) != CS_SUCCEED)
{
return(CS_FAIL);
}
return(CS_SUCCEED);
}
The datatype set through srv_setcolutype is the datatype the client application will receive through the DB-Library call dbcolutype or through the Client-Library call ct_describe.