Determine how large a buffer to allocate to hold the results returned by dbsprhead, dbsprline, and dbspr1row.
DBINT dbspr1rowlen(dbproc) DBPROCESS *dbproc;
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 size of the buffer, in bytes, required by dbsprhead, dbsprline, and dbspr1row on success; a negative integer on error.
dbspr1rowlen determines the size of the buffer (in bytes) required by dbsprhead, dbsprline, and dbspr1row, including the null terminator.
dbspr1rowlen is useful when printing data for debugging and when scrolling data displays.
To make the best use of dbspr1rowlen, application programs should call it once for every successful call to dbresults.
The following code fragment illustrates the use of dbspr1rowlen:
dbcmd(dbproc, "select * from sysdatabases");
dbcmd(dbproc, " order by name");
dbcmd(dbproc, " compute max(crdate) by name");
dbsqlexec(dbproc);
dbresults(dbproc);
printf("Maximum row length will be %ld \
characters.\n", dbspr1rowlen(dbproc));