FNC_TblOpRead Function | C Library Functions | Teradata Vantage - 17.10 - FNC_TblOpRead - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

Allows table operator writers to read rows from an input stream. The function sets the read context to the next input row of data and returns an integer that indicates TBLOP_SUCCESS, TBLOP_EOF (no more data), TBLOP_ABORT, or TBLOP_ERROR.


FNC_TblOpRead(FNC_TblOpHandle_t *handle)

Syntax Elements

a handle associated with an input stream. This should be the handle returned by FNC_TblOpOpen.

For details about the FNC_TblOpHandle_t structure, see Table Operator Data Structures.

Usage Notes

You can read all or a subset of the input rows. For more efficient access, the data can be directly accessed through the handle structure.

You must call FNC_TblOpOpen first, then pass the handle returned from FNC_TblOpOpen as an argument to FNC_TblOpRead. If you call FNC_TblOpOpen with the options field set to TBLOP_NOOPTIONS, the read call prepares the field access allowing direct access to individual attributes via FNC_TblOpGetAttributeByNdx or directly via handle->row->indicators, columnptr[index] and lengths[index].

If the options field is set to TBLOP_RAWMODE, the raw row can be accessed as follows:
Access handle->row to access the current raw row length, 
IndicData format, record body)

TBLOP_EOF is returned if you read past the End of File. If you specify the PARTITION BY clause, End of File occurs after the last row in the partition is read.

Example Using FNC_TblOpRead

See C Table Operator for an example of how to use this function.

Related Information

For details about the Custom clause of a table operator, see information about the SELECT statement FROM clause in Teradata Vantageā„¢ - SQL Data Manipulation Language, B035-1146.

For information about the current_row_t structure which stores information about the current row, see Table Operator Data Structures.