Once the TPF is finished processing table data, it closes the open result set using the close_result_set method of a_v4_extfn_proc_context.
This code snippet illustrates close_result_set closing a result set.
ctx->close_result_set( ctx, rs ) );