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