16.20 - C Table Function - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

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);