16.20 - getCharacterStream() - 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

Retrieves the XML value designated by this SQLXML instance as a java.io.Reader object.

Syntax

Reader getCharacterStream()
                throws SQLException

Return Value

A stream containing the XML data.

The format of this stream is defined by org.xml.sax.InputSource, where the characters in the stream represent the Unicode code points for XML according to Section 2 and Appendix B of the XML 1.0 specification.

Although an encoding declaration other than Unicode may be present, the encoding of the stream is Unicode.

Usage Notes

The behavior of this method is the same as ResultSet.getCharacterStream() when the designated column of the ResultSet has a type java.sql.Types of SQLXML.

The SQL XML object becomes unreadable when this method is called and may also become not writable depending on the implementation.

Exceptions

Throws SQLException if there is an error processing the XML value. The getCause() method of the exception may provide a more detailed exception, such as if the stream does not contain valid characters.

An exception is thrown if the state is not readable. A database specific code “9752 (ERRUDFJAVAXML) <Error retrieving XML value in getCharacterStream>” is returned.