16.20 - Usage Notes - 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)

You can use this function to close an input or output stream within a table operator invocation. The function closes the stream. When closing an output stream in protected mode, this function flushes the buffer to the database. After calling this function, Read and Write calls are no longer valid; however, you can call FNC_TblOpClose prior to reading all of the rows.

You can close and reopen an input stream within a request that did not specify a PARTITION BY clause. You can close an output stream a single time within a table operator invocation.

If you specify the PARTITION BY clause, then opening or closing a stream refers to the rows within the partition. For example, End of File occurs after the last row in the partition is read. If you do not specify the PARTITION BY clause, opening or closing a stream refers to the rows within the AMP.

The following are not allowed and result in an error:

  • Close an input or output stream that is not open.
  • Close and reopen an output stream.