16.20 - tdr.GetFormat - 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)

Purpose

Retrieves information about the format of a specified stream.

Syntax

tdr.GetFormat(  attribute,  streamno,  direction  )
attribute
Parameter type: character

The format attribute to be retrieved.

Currently, the only valid value for attribute is "RECFMT", which defines the input/output record format.

streamno
Parameter type: integer

The stream number.

direction
Parameter type: character
Valid values are as follows:
  • "R" (input)
  • "W" (output)

Return Value

The value of the specified format attribute for the given stream.

Currently, the attribute value returned is an integer that indicates the record format as follows:
  • 1 for IndicData with row separator sentinels
  • 2 for IndicData with no row or partition separator sentinels

Usage Notes

This function can be called from the table operator as well as the contract function.

Example: Print the Record Format of an Input Stream

The following statement prints the record format of input stream 0:

print(tdr.GetFormat("RECFMT", 0, "R"))