Home | Previous Page | Next Page   Database Access > Executing SQL Statements >

Retrieving Query Data

When mi_get_result( ) returns the MI_ROWS statement status, the query has executed and a cursor is open, as follows:

The DataBlade API module receives the query data on a row-by-row basis. To handle the rows that the current statement has retrieved, the DataBlade API creates the following data type structures:

A one-to-one correspondence occurs between row descriptors and rows. Each row descriptor has an associated row structure.

Server Only

In a C UDR, the row structure and row descriptor are part of the same data type structure. The row structure is just a data buffer in the row descriptor that holds copies of the column values of a row.

End of Server Only

The row descriptor and row structure are valid until the next row is fetched. A row descriptor might need to change on a row-to-row basis for jagged rows. (For more information, see Obtaining Jagged Rows.) A row structure holds each row, one row at a time.

To retrieve the row of query data
  1. Get a copy of the row descriptor for a query row.
  2. Get the number of columns from the row descriptor.
  3. Retrieve query rows, one row at a time.
  4. For every query row, get the value of any desired column.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]