home *** CD-ROM | disk | FTP | other *** search
-
- 1 Version 4.0 -- 5/1/89 dbnumcols
- ______________________________________________________________________
-
- NAME: dbnumcols
-
- FUNCTION:
- Determine the number of regular columns for the current set of
- results.
-
- SYNTAX:
- int dbnumcols(dbproc)
-
- DBPROCESS *dbproc;
-
- COMMENTS:
-
-
-
-
-
-
-
- dbnumcols Version 4.0 -- 5/1/89 2
- ______________________________________________________________________
-
- o dbnumcols() returns the number of regular (i.e., non-compute)
- columns in the current set of results.
- o Here's a program fragment that illustrates the use of
- dbnumcols():
-
- int column_count;
- DBPROCESS *dbproc;
-
- /* put the commands into the command buffer */
- dbcmd(dbproc, "select name, id, type from sysobjects");
- dbcmd(dbproc, " select name from sysobjects");
-
- /* send the commands to SQL Server and start execution */
- dbsqlexec(dbproc);
-
- /* process each command until there are no more */
-
-
-
- 3 Version 4.0 -- 5/1/89 dbnumcols
- ______________________________________________________________________
- while (dbresults(dbproc) != NO_MORE_RESULTS)
- {
- column_count = dbnumcols(dbproc);
- printf("%d columns in this SQL Server result.\n",
- column_count);
- while (dbnextrow(dbproc) != NO_MORE_ROWS)
- printf("row received.\n");
- }
-
-
- PARAMETERS:
- dbproc - A pointer to the DBPROCESS structure that provides the
- connection for a particular front-end/SQL Server process. It
- contains all the information that DB-Library uses to manage
- communications and data between the front end and SQL Server.
-
- RETURNS:
-
-
-
- dbnumcols Version 4.0 -- 5/1/89 4
- ______________________________________________________________________
- The number of columns in the current set of results. If there
- are no columns, dbnumcols() returns 0.
-
- SEE ALSO:
- dbcollen, dbcolname, dbnumalts
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-