Syntax - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™
FNC_ColumnDef_t *
FNC_TblGetColDef()
FNC_ColumnDef_t
typedef struct
{
   int    num_columns;
   parm_t column_types[1];
} FNC_ColumnDef_t;
parm_t
Defined in sqltypes_td.h as:
typedef struct parm_t
{
  dtype_et    datatype;
  dmode_et    direction;
  charset_et  charset;
  union {
    long  length;
    int   intervalrange;
    int   precision;
    struct {
      int  totaldigit;
      int  fracdigit;
    } range;
  } size;
} parm_t;

Syntax Elements

num_columns
Number of entries in the column_types array, which is the same as the number of result columns for the table function execution.
column_types
A parm_t array that provides the data type and attributes of each result column.
datatype
Specifies the data type of the column. The sqltypes_td.h header file defines dtype_et as:
typedef int dtype_et;
Valid values are defined by the dtype_en enumeration in sqltypes_td.h. For a list of the valid values, see the dtype argument in FNC_CallSP.
direction
Does not provide information about result column definitions. For details on the direction member of the parm_t structure, see FNC_CallSP.
charset
Specifies the character set of CHAR or VARCHAR data.

The sqltypes_td.h header file defines charset_et as:

typedef int charset_et;

Valid values are defined by the charset_en enumeration in sqltypes_td.h:

typedef enum charset_en
{
   UNDEF_CT=0,
   LATIN_CT=1,
   UNICODE_CT=2,
   KANJISJIS_CT=3,
   KANJI1_CT=4
} charset_en;
length
Specifies the length of a CHAR, VARCHAR, or BYTE type.
intervalrange
Specifies the range of an INTERVAL type. For example, 4 for INTERVAL YEAR(4).
precision
Specifies the precision in a TIME or TIMESTAMP type. For example, 4 for TIME(4).
totaldigit
Specifies the value m in a DECIMAL(m,n) or INTERVAL SECOND (m,n) type.
fracdigit
Specifies the value n in a DECIMAL(m,n) or INTERVAL SECOND (m,n) type.