AS_SHRED_BATCH Syntax - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
TD_SYSXML.AS_SHRED_BATCH (
  queryString,
  annotatedSchema,
  externalContext,
  resultCode
)

Syntax Elements

queryString
An SQL query that returns 2 columns:
  • An ID column
  • A column that contains the XML document to be shredded as an XML data type

    If queryString is NULL, the stored procedure returns a resultCode of 1 without performing any operations.

IN parameter of data type VARCHAR(20000), CHARACTER SET UNICODE.
annotatedSchema
An annotated schema that maps the XML document structure to the target tables to update. If annotatedSchema is NULL or is not a valid mapping definition, an error is raised.
IN parameter of data type XML.
externalContext
Configuration values used to override equivalent parameters specified in the annotated schema mapping. This must be a comma separated list of name=value pairs and the names must match one of the configuration parameters in the annotated schema.
Four parameter values can be set through the externalContext:
  • defaultDatabase
  • defaultEncoding
  • rootElement
  • errorTable
For explanations of the defaultDatabase, defaultEncoding, and rootElement options, see the description of the corresponding elements in the discussion of Adding Schema Annotations
The errorTable option allows you to specify the fully qualified name of a table to which to write error information if any of the documents fails shredding. Specifying this option activates a more permissive form of shredding in which failure of any individual document during shredding does not cause the abortion of the entire shredding procedure. Instead, the remaining valid documents in the batch are shredded, and the error information for the documents that failed shredding is written to an error table.
IN parameter of data type VARCHAR(512), CHARACTER SET UNICODE.
resultCode
A return code where:
  • 0 = success
  • 1 = failure
OUT parameter of data type INTEGER.