Getting result data

The simplest way to get result data is to bind result columns to program variables, using dbbind and dbaltbind. Then, when the application calls dbnextrow to read a result row (see “Reading result rows”), DB-Library/C will automatically place copies of the columns’ data into the program variables to which they are bound. The application must call dbbind and dbaltbind after a dbresults call but before the first call to dbnextrow.

You can also access a result column’s data directly with dbdata and dbadata, which return pointers to the data. dbdata and dbadata have the advantage of providing access to the actual data, not a copy of the data. These routines are frequently used in conjunction with dbdatlen and dbadlen, which return the length of the data and are described in the section “Information retrieval”. When you are accessing data directly with these routines, you do not perform any preliminary binding of result columns to program variables. Simply call dbdata or dbadata after a dbnextrow call.

The following routines are used to retrieve result columns: