The EXTFNAPIV4_DESCRIBE_PARM_TABLE_REQUEST_REWIND attribute indicates that the consumer requests rewind of an input table. Used in a describe_parameter_set scenario.
a_sql_byte
Indicates that the consumer wants to rewind an input table. Valid only for table input arguments. By default, this property is false.
If the UDF requires input table rewind capability, the UDF must set this property during Optimization.
On success, returns sizeof(a_sql_byte).
In this example, when the function my_udf_describe is called during the Optimization state, the call to describe_parameter_set informs the producer of the table input parameter 1 that a rewind may be required.
Sample procedure definition:
CREATE PROCEDURE my_udf(IN t TABLE(c1 INT)) RESULT (x INT) EXTERNAL NAME ‘my_udf@myudflib’;
Sample _describe_extfn API function code fragment:
my_udf_describe(a_v4_extfn_proc_context *cntxt) { if( cntxt->current_state == EXTFNAPIV4_STATE_OPTIMIZATION ) { a_sql_byte rewind_required = 1; a_sql_int32 ret = 0; ret = cntxt->describe_parameter_set( cntxt, 1, EXTFNAPIV4_DESCRIBE_PARM_TABLE_REQUEST_REWIND, &rewind_required, sizeof(a_sql_byte) ); if( ret <= 0 ) { // Handle the error. } } }