Jump to content

SQL/XML

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Krauss (talk | contribs) at 10:16, 7 November 2011 (ext2ref). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The SQL/XML, or XML-Related Specifications, extension to the SQL standard is defined by ISO/IEC 9075-14 (see SQL). SQL/XML specifies SQL-based extensions for using XML in conjunction with SQL. The XML data type is introduced, as well as several routines, functions, and XML-to-SQL data type mappings to support manipulation and storage of XML in a SQL database.

The SQL/XML specification includes functions to construct XML data. These functions allow the user to construct new XML elements or attributes with values e.g. from relational tables. Other functions such as XMLCONCAT or XMLAGG can be used to combine small XML fragments into larger ones. The list of available construction functions includes:

  • XMLELEMENT
  • XMLATTRIBUTES
  • XMLFOREST
  • XMLCONCAT
  • XMLNAMESPACES
  • XMLCOMMENT
  • XMLPI
  • XMLDOCUMENT
  • XMLAGG
  • etc.

SQL/XML also defines functions which allow the user to embed XQuery expressions in SQL statements, and to convert complex data types. These functions include:

  • XMLQUERY
  • XMLTABLE

While XMLQUERY returns values of type XML, the function XMLTABLE can take XML data as input and produce a relational table as output. Predicates on XML data, such as search conditions, can be expressed with the XMLEXISTS predicate, typically in the WHERE clause of a SQL statement.

SQL/XML is developed to be complementary to XQuery [1].

Further information and examples of the SQL/XML functions are provided in the external links below [2], [3], [4].

References

  1. ^ "XML programming with SQL/XML and XQuery", J. E. Funderburk, S. Malaika, and B. Reinwald (2002) http://ict.udlap.mx/people/carlos/is346/files/reinwald.pdf
  2. ^ Michael Wagner: SQL/XML:2006 - Evaluierung der Standardkonformität ausgewählter Datenbanksysteme 1. Auflage, Diplomica Verlag, ISBN 3-8366-9609-6
  3. ^ "Advancements in SQL/XML", J. Melton; SIGMOD Record
  4. ^ "SQL/XML is Making Good Progress", A. Eisenberg, J. Melton; SIGMOD Record 31(2): 101-108 2002