XML - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

C Data Type Definition

typedef int XML_HANDLE;

Usage

Use the XML_HANDLE data type when passing an XML instance as an argument or returning an XML type result.

Here is an example using an XML parameter in a UDF definition and XML_HANDLE in a C function declaration.

SQL Function Definition Equivalent C Function Declaration
CREATE FUNCTION F1 (A XML(100))
RETURNS XML(100)
 ...;
void f1( XML_HANDLE *a,
         XML_HANDLE *result,
         ... )
{  ... }

UDFs, UDMs, and external stored procedures can also process XML data as VARCHAR, CLOB, VARBYTE, or BLOB values. You can use the XMLSERIALIZE function to serialize an XML value to a VARCHAR, CLOB, VARBYTE, or BLOB value before passing it to an external routine. You can use the CREATEXML function to create an XML type value from the results of an external routine.

For information about the XMLSERIALIZE and CREATEXML functions, see Teradata Vantage™ - XML Data Type, B035-1140.

Therefore, in addition to the XML_HANDLE data type, you can also use the following C data types as parameters and return types of UDFs, UDMs, and external stored procedures that process XML: