FNC_TblOpRead Function | C Library Functions | Teradata Vantage - FNC_TblOpRead - 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ā„¢

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.

Syntax

int
FNC_TblOpRead(FNC_TblOpHandle_t *handle)

Syntax Elements

handle
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.