Get a formatted string that contains underlining for the column names produced by dbsprhead.
RETCODE dbsprline(dbproc, buffer, buf_len, linechar) DBPROCESS *dbproc; char *buffer; DBINT buf_len; DBCHAR linechar;
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.
A pointer to a character buffer to contain the dbsprline results.
The length of buffer, including its null terminator.
The character with which to “underline” column names produced by dbsprhead.
SUCCEED or FAIL.
If an error occurs, the contents of *buffer are undefined.
dbsprline is used to “underline” the column names produced by dbsprhead. dbsprline fills a programmer-supplied buffer with a null-terminated character string containing one group of the character specified by linechar for each column in the current set of query results. The format of this line matches the format of the output of dbsprhead.
You can determine the length of the buffer required by dbsprline using dbspr1rowlen.
To make the best use of dbsprhead, application programs should call it once for every successful call to dbresults.
dbsprline is useful when printing data for debugging, and when scrolling data displays.
The following code fragment illustrates the use of dbsprline:
dbcmd(dbproc, "select * from sysdatabases");
dbcmd(dbproc, " order by name");
dbcmd(dbproc, " compute max(crdate) by name");
dbsqlexec(dbproc);
dbresults(dbproc);
/*
** Display the column headings, underline them
** with "*"
*/
dbsprhead(dbproc, buffer, sizeof(buffer));
printf("%s\n", buffer);
dbsprline(dbproc, buffer, sizeof(buffer), ’*’);
printf("%s\n", buffer);
/* Process returned rows as usual */
dbprhead, dbprrow, dbspr1row, dbspr1rowlen, dbsprhead, Options