Use the GET_TABLE_COLUMN_COUNT function to retrieve the total number of columns in a table, including the number of key columns.
#include "usrdecs.h" short result_code; table_def table; ERCALLBACK (GET_TABLE_COLUMN_COUNT, &table, &result_code);
typedef struct
{
short num_columns;
short source_or_target;
/* Version 2 CALLBACK_STRUCT_VERSION */
short num_key_columns;
} table_def;
source_or_targetOne of the following indicating whether to return the total number of columns for the source or target table.
EXIT_FN_SOURCE_VAL EXIT_FN_TARGET_VAL
num_columnsThe returned total number of columns in the specified table.
num_key_columnsThe returned total number of columns that are being used by Oracle GoldenGate as the key for the specified table.