XMLPUBLISH Stored Procedure | XML Data Type | Teradata Vantage - XMLPUBLISH - Analytics Database - Teradata Vantage

XML Data Type

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
tkc1628112506748.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
dgs1472251600184
lifecycle
latest
Product Category
Teradata Vantageā„¢

Publishes SQL query results in an XML format specified by the user.

The stored procedure takes the following as input arguments:

  • An SQL query string
  • A mapping stylesheet that will transform the results of the SQL query to the desired XML structure.

    If you do not specify a mapping (you pass NULL as the Xslt argument), the procedure returns the canonical XML representation as output.

Recommendation: Use this stored procedure in the following cases:

  • The size of the documents being published is small
  • The use of Teradata specific instructions, like teradata_group, is not required
    Teradata specific instructions are ignored by XMLPUBLISH.
  • You need to publish multiple documents

For other cases, use the XMLPUBLISH_STREAM stored procedure instead.

Required Privileges

The XMLPUBLISH stored procedure is created under the user TD_SYSXML.

The user invoking this stored procedure must have the following privileges:
  • EXECUTE PROCEDURE on TD_SYSXML
  • SELECT privilege on the staging table
  • GRANT ALL (insert/update/delete/upsert) on the target tables

Result Type

The result XmlString is a string representation of the XML to be published.

XMLPUBLISH returns a resultCode value:
  • 0 indicates that the procedure executed successfully.
  • -1 indicates that the procedure resulted in an error.