7.14 GET_COLUMN_NAME

Given a column index, returns the name.

Syntax

For C:

#include "usrdecs"
short    result;
short    col_idx;
char     col_name[36];
short    max_name_len, 
short    source_or_target;
result = GET_COLUMN_NAME(col_idx, col_name, max_name_len, source_or_target);

For TAL:

?source usrdect
int result;
int     col_idx;
string .ext column_name;
int     max_name_len;
int     source_or_target;
result := GET_COLUMN_NAME (col_idx, col_name, max_name_len,
                           source_or_target);

For COBOL:

?CONSULT =EXTRACT (or =REPLICAT)
01 result       PIC S9(4) COMP.
01 col-idx      PIC S9(4) COMP.
01 col-name     PIC x(36).
01 max-name-len PIC S9(4) COMP.
ENTER C "GET_COLUMN_NAME" using col-idx, col-name, max-name-len, 
                          source-or-target giving result.
col_idx
col-idx

A sequential number from 0 to (number of columns - 1) that identifies a column.

col_name
col-name

The name of the column.

max_name_len

The maximum length of the returned column name.

source_or_target
source-or-target

Represented by either EXIT‐FN‐SOURCE‐VAL or EXIT-FN-TARGET-VAL to indicate whether the record is a source or target record.

result

A code indicating whether the call was successful or not.