dbfirstrow

DB Library for C

DB Library for C

dbfirstrow

Returns the number of the first row in the row buffer.

Syntax

DBINT dbfirstrow ( PDBPROCESS dbproc );

Arguments

dbproc

Is the DBPROCESS structure that is the handle for a particular workstation or Microsoft® SQL Server™ 2000 process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.

Returns

The number of the first row in the row buffer. The first row returned from SQL Server is number 1. Use this return value when making a call to dbgetrow.

Remarks

If you are not buffering rows, dbfirstrow, dbcurrow, and dblastrow always have the same value: the current row number in the current batch. If you enable buffering by setting the DBBUFFER option, dbfirstrow returns the number of the row that is the first row in the row buffer. For example, if a query returns 100 result rows and you read 20 rows into the buffer using dbnextrow, dbfirstrow returns 1, regardless of which row is current. As the application processes and clears rows from the buffer using dbclrbuf and more data is read from the server using dbnextrow, dbfirstrow returns the number of the result row stored in the lowest (oldest) buffer location.

dblastrow returns the number of the result row stored in the highest (newest) buffer location.

See Also

Bulk-Copy Functions

dblastrow

dbclrbuf

DB-Library Options

dbcurrow

dbnextrow

dbgetrow

dbsetopt