describe_parameter_set Example # 6: One-Column Partitioning on Column 2

An example UDF that informs the server to perform partitioning on column 2 (c2).

void UDF_CALLBACK my_tpf_proc_describe( a_v4_extfn_proc_context *ctx )
{
    if( ctx->current_state == EXTFNAPIV4_STATE_ANNOTATION ) {
        a_sql_int32            rc = 0;
        a_v4_extfn_column_list pbcol = 
            { 1,		// 1 column in the partition by list
              2 };	// column index 2 requires partitioning

        // Describe partitioning for argument 1 (the table)
        rc = ctx->describe_parameter_set( 
ctx, 
                  1, 
                  EXTFNAPIV4_DESCRIBE_PARM_TABLE_PARTITIONBY, 
                  &pbcol, 
                  sizeof(pbcol) );

	if( rc == 0 ) {
          ctx->set_error( ctx, 17000, 
              “Runtime error, unable set partitioning requirements for column.” );
      }
   }
}
Related reference
Example Procedure Definition
describe_parameter_set Example # 1: One-Column Partitioning on Column 1
describe_parameter_set Example # 2: Two-Column Partitioning
describe_parameter_set Example # 3: Any-Column Partitioning
describe_parameter_set Example # 4: No Support for PARTITION BY ANY Clause
describe_parameter_set Example # 5: No Partitioning Support