Usage Notes - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantageā„¢

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.