Partition By Column Number (a_v4_extfn_partitionby_col_num)

The a_v4_extfn_partitionby_col_num enumerated type represents the column number to allow the UDF to express PARTITION BY support similar to that of SQL support.

Implementation

typedef enum a_v4_extfn_partitionby_col_num {
    EXTFNAPIV4_PARTITION_BY_COLUMN_NONE = -1,		// NO PARTITION BY
    EXTFNAPIV4_PARTITION_BY_COLUMN_ANY  = 0,		// PARTITION BY ANY
    							// + INTEGER representing a specific column ordinal
} a_v4_extfn_partitionby_col_num;

Members Summary

Member of a_v4_extfn_partitionby_col_num Enumerated Type Value Description
EXTFNAPIV4_PARTITION_BY_COLUMN_NONE -1 NO PARTITION BY
EXTFNAPIV4_PARTITION_BY_COLUMN_ANY 0 PARTITION BY ANY positive integer representing a specific column ordinal
Column Ordinal Number N > 0 Ordinal for the table column number to partition on

Description

This structure allows the UDF to programmatically describe the partitioning and the column to partition on.

Use this enumeration when populating the a_v4_extfn_column_list number_of_columns field. When describing partition by support to the server, the UDF sets the number_of_columns to one of the enumerated values, or to a positive integer representing the number of column ordinals listed. For example, to describe to the server that no partitioning is supported, create the structure as:
a_v4_extfn_column_list nopby = {
EXTFNAPIV4_PARTITION_BY_COLUMN_NONE,
0
};

The EXTFNAPIV4_PARTITION_BY_COLUMN_ANY member informs the server that the UDF supports any form of partitioning.

To describe a set of ordinals to partition on, create the structure as:
a_v4_extfn_column_list nopby = {
2,
3, 4
};
This describes a partition by over 2 columns whose ordinals are 3 and 4.
Note: This example is for illustrative purposes only and is not legal code. The caller must allocate the structure accordingly with room for 3 integers.