16.20 - FNC_TblOpWrite - 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

Allows table operator writers to write rows to spool. The function sets the write context to the next output row.

Syntax

int
FNC_TblOpWrite(FNC_TblOpHandle_t *handle);
FNC_TblOpHandle_t *handle
a handle associated with an output stream. This should be the handle returned by FNC_TblOpOpen.

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

Return Value

An integer that indicates TBLOP_SUCCESS, TBLOP_NOROW, TBLOP_ABORT, or TBLOP_ERROR.

Usage Notes

You must call FNC_TblOpOpen first, then pass the handle returned from FNC_TblOpOpen as an argument to FNC_TblOpWrite.

If the stream was opened with the TBLOP_NOOPTIONS option, the row fields can be directly set with function FNC_TblOpBindAttributeByNdx, or directly set assigning:

handle->row->indicators, columnptr[index] and lengths[index].

If you call FNC_TblOpOpen with the options field set to TBLOP_RAWMODE, the raw row can be directly set through the handle structure:

Access handle->row to set the current raw row (length, IndicData format, record body)

Example Using FNC_TblOpWrite

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

Related Topics

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