Example: lrd_fetchx

In the following example, a SELECT statement retrieves all of the database records that contain a value of 1000 or greater in their SAL column. lrd_exec executes the statement and lrd_bind_col binds all the host variables to columns. The lrd_fetchx function gets the data and prepares it for display in a grid using an ODBC extended fetch.

 /* Set up and execute the SQL statement. */
lr_think_time (76);
lrd_stmt(Csr1, "select ename from emp where (sal>=1000)\n", -1, 1, 1, 0);
lrd_bind_col(Csr1, 1, &D21_ENAME, 0);
lrd_exec(Csr1, 0, 0, 0, 0);
lrd_fetchx(Csr1, -3, 1, 0, PrintRow24, LRD_FETCHX_ODBC_OPT_EXT, 0);