Returns the user-defined data type for a regular result column.
DBINT dbcolutype (
PDBPROCESS dbproc,
INT column );
dbproc
Is the DBPROCESS structure that is the handle for a particular workstation or Microsoft® SQL Server™ 2000 process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.
column
Is the number of the column. The first column is number 1. For further information, see dbadata.
The column parameter's user-defined data type on success and -1 on error.
This function is defined as data type DBINT to accommodate the size of user-defined data types. Both DBINT and user-defined data types are 32 bits long. Call dbcolutype after dbresults returns SUCCEED.
This example shows how to use dbcolutype:
DBPROCESS *dbproc;
int colnum;
int numcols;
// Put the command into the command buffer.
dbcmd (dbproc, "SELECT * FROM mytable");
// Send the command to the SQL Server and begin execution.
dbsqlexec(dbproc);
// Process the command results.
dbresults(dbproc);
// Examine the user-defined column types.
numcols = dbnumcols(dbproc);
for (colnum = 1; colnum < numcols; colnum++)
{
printf
("column %d, user-defined type is %ld.\n",
colnum, dbcolutype(dbproc, colnum));
}