Return the name of a regular result column.
char *dbcolname(dbproc, column) DBPROCESS *dbproc; int column;
A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.
The number of the column of interest. The first column is number 1.
A CHAR pointer to the null-terminated name of the particular column. If the column number is not in range, dbcolname returns NULL.
This routine returns a pointer to the null-terminated name of a regular (that is, non-compute) result column.
Here is a small program fragment that uses dbcolname:
DBPROCESS *dbproc;
/* Put the command into the command buffer */
dbcmd(dbproc, "select name, id, type from
sysobjects");
/*
** Send the command to Adaptive Server Enterprise and begin
** execution
*/
dbsqlexec(dbproc);
/* Process the command results */
dbresults(dbproc);
/* Examine the column names */
printf("first column name is %s\n",
dbcolname(dbproc, 1));
printf("second column name is %s\n",
dbcolname(dbproc, 2));
printf("third column name is %s\n",
dbcolname(dbproc, 3));