The consumer uses the a_v4_extfn_table_func structure to retrieve results from the producer.
typedef struct a_v4_extfn_table_func {
// size_t struct_size;
/* Open a result set. The UDF can allocate any resources needed for the result set.
*/
short (UDF_CALLBACK *_open_extfn)(a_v4_extfn_table_context *);
/* Fetch rows into a provided row block. The UDF should implement this method if it does
not have a preferred layout for its transfer area.
*/
short (UDF_CALLBACK *_fetch_into_extfn)(a_v4_extfn_table_context *, a_v4_extfn_row_block
*row_block);
/* Fetch a block that is allocated and configured by the UDF. The UDF should implement this
method if it has a preferred layout of the transfer area.
*/
short (UDF_CALLBACK *_fetch_block_extfn)(a_v4_extfn_table_context *, a_v4_extfn_row_block
**row_block);
/* Restart a result set at the beginning of the table. This is an optional entry point.
*/
short (UDF_CALLBACK *_rewind_extfn)(a_v4_extfn_table_context *);
/* Close a result set. The UDF can release any resources allocated for the result set.
*/
short (UDF_CALLBACK *_close_extfn)(a_v4_extfn_table_context *);
/* The following fields are reserved for future use and must be initialized to NULL. */
void *_reserved1_must_be_null;
void *_reserved2_must_be_null;
} a_v4_extfn_table_func;
| Method | Data Type | Description |
|---|---|---|
| _open_extfn | void | Called by the server to initiate row fetching by opening a result set. The UDF can allocate any resources needed for the result set. |
| _fetch_into_extfn | short | Fetch rows into a provided row block. The UDF implements this method, if it does not have a preferred layout for its transfer area. |
| _fetch_block_extfn | short | Fetch a block that is allocated and configured by the UDF. The UDF implements this method, if it has a preferred layout of the transfer area. |
| _rewind_extfn | void | Optional function called by the server to restart the fetching from the beginning of the table. |
| _close_extfn | void | Called by the server to terminate row fetching by closing the result set. The UDF can release any resources allocated for the result set. |
| _reserved1_must_be_null | void | Reserved for future use. Must be initialized to NULL. |
| _reserved1_must_be_null | void | Reserved for future use. Must be initialized to NULL. |
The a_v4_extfn_table_func structure defines the methods used to fetch results from a table.