Returns the user-defined datatype for a regular result column.
DBINT dbcolutype (
PDBPROCESS dbproc,
INT column );
where
The column parameter's user-defined datatype on success and -1 on error.
For a description of how to add user-defined datatypes to SQL Server databases, see the Microsoft SQL Server Transact-SQL Reference.
This function is defined as datatype DBINT to accommodate the size of user-defined datatypes. Both DBINT and user-defined datatypes 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)); }