C Table Function | UFC Code Examples | Teradata Vantage - C Table Function - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

This example shows the C code for a table function. The example uses the following tables, data, and include file:

CREATE TABLE t (v INTEGER);

INSERT INTO t (1);
INSERT INTO t (2);
INSERT INTO t (3);
INSERT INTO t (4);
INSERT INTO t (5);
INSERT INTO t (6);
INSERT INTO t (7);
INSERT INTO t (8);
INSERT INTO t (9);
INSERT INTO t (10);

CREATE MULTISET GLOBAL TEMPORARY TRACE TABLE udftrace ,NO FALLBACK ,
     CHECKSUM = DEFAULT,
     NO LOG
     (
        Amp_number BYTE(2),
        Sequence INTEGER,
        Message VARCHAR(500)
     );

The phasetrace.h include file contains the following:

void trace (char *input_string);