Obtain row information
A row descriptor (MI_ROW_DESC) contains information about the columns in a row.
For example, the row descriptor for the following query would contain
two columns, order_num and order_date:
SELECT order_num, order_date FROM orders
WHERE ship_date > "07/15/98";
To obtain a row descriptor for a row, you can use one of the DataBlade®
API functions
in the following table.
Use | DataBlade® API function | Description |
---|---|---|
For rows with the same type and size | mi_get_row_desc_without_row() | Returns a row descriptor for the current statement |
For rows with the same type and size | mi_get_statement_row_desc() | Returns a row descriptor for a prepared statement |
For rows of different types or sizes (jagged rows) | mi_get_row_desc() | Returns a row descriptor associated with a particular row structure |
For rows of different types or sizes (jagged rows) | mi_get_row_desc_from_type_desc() | Returns a row descriptor based on a type descriptor |
These functions allocate the memory for the row descriptor that they allocate.
To obtain a row descriptor for the query rows in an implicit or explicit cursor, use the mi_get_row_desc_without_row() function. To free this row descriptor, complete the query.