tdr.SetOutputColDef Function | R Table Operators | Teradata Vantage - tdr.SetOutputColDef - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

Sets the schema of the output stream.

Syntax

tdr.SetOutputColDef(  streamno,  coldef  )

Syntax Elements

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