tdr.SetOutputColDef Function | R Table Operators | Teradata Vantage - tdr.SetOutputColDef - 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™

Purpose

Sets the schema of the output stream.

Syntax

tdr.SetOutputColDef(  streamno,  coldef  )
streamno
Parameter type: integer

The output stream number.

coldef
Parameter type: list
The schema of a stream. This schema is a list with the number of columns and the definition of each column. Each definition includes the following column information:
  • Type

    Valid data type values are defined by the dtype_en enumeration in the sqltypes_td.h header file.

  • Size (in bytes)
  • Character type for textual fields:
    • 1 for LATIN
    • 2 for UNICODE

Usage Notes

This function is valid only if called from the contract function.

An error is raised if the function is called from the table operator.

Example: Set the Column Definitions of an Output Stream

This example sets the column definitions of an output stream with three attributes (COL1 int, COL2 real, COL3 varchar(30)).

stream <- 0;
integer = list( datatype="INTEGER_DT", bytesize=4 );
real <- list( datatype="REAL_DT", bytesize=8 );
varchar30 <- list(datatype="VARCHAR_DT", charset="LATIN_CT", size.length=30);
coldef <- list(COL1=integer, COL2=real, COL3=varchar30);
tdr.SetOutputColDef(stream, coldef);