Returns a pointer to the null-terminated name of a particular result column.
LPCSTR dbcolname (
PDBPROCESS dbproc,
INT column );
where
A char pointer to the null-terminated name of the particular column. If the column number is not in range or if the column is the result of an expression with no name assigned, dbcolname returns null. If the column number is out of range, dbcolname also calls the error handler with an error of 10011 (SQLECNOR).
The following example shows how to use dbcolname:
DBPROCESS *dbproc; // Put the command into the command buffer. dbcmd(dbproc, "select name, id, type from sysobjects"); // Send the command to SQL Server 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));
dbcollen, dbcoltype, dbdata, dbdatlen, dbnumcols