Updated on 2025-08-25 GMT+08:00

Mapping a Table to XML

table_to_xml(tbl regclass, nulls boolean, tableforest boolean, targetns text)

Description: Maps the contents of a table to XML values.

Return type: XML.

table_to_xmlschema(tbl regclass, nulls boolean, tableforest boolean, targetns text)

Description: Maps a relational table schema to an XML schema document.

Return type: XML.

table_to_xml_and_xmlschema(tbl regclass, nulls boolean, tableforest boolean, targetns text)

Description: Maps a relational table to XML values and schema documents.

Return type: XML.

query_to_xml(query text, nulls boolean, tableforest boolean, targetns text)

Description: Maps the contents of a SQL query to XML values.

Return type: XML.

query_to_xmlschema(query text, nulls boolean, tableforest boolean, targetns text)

Description: Maps a SQL query into an XML schema document.

Return type: XML.

query_to_xml_and_xmlschema(query text, nulls boolean, tableforest boolean, targetns text)

Description: Maps SQL queries to XML values and schema documents.

Return type: XML.

cursor_to_xml(cursor refcursor, count int, nulls boolean, tableforest boolean, targetns text)

Description: Maps a cursor query to an XML value.

Return type: XML.

cursor_to_xmlschema(cursor refcursor, nulls boolean, tableforest boolean, targetns text)

Description: Maps a cursor query to an XML schema document.

Return type: XML.

schema_to_xml(schema name, nulls boolean, tableforest boolean, targetns text)

Description: Maps a table in a schema to an XML value.

Return type: XML.

schema_to_xmlschema(schema name, nulls boolean, tableforest boolean, targetns text)

Description: Maps a table in a schema to an XML schema document.

Return type: XML.

schema_to_xml_and_xmlschema(schema name, nulls boolean, tableforest boolean, targetns text)

Description: Maps a table in a schema to an XML value and a schema document.

Return type: XML.

database_to_xml(nulls boolean, tableforest boolean, targetns text)

Description: Maps a database table to an XML value.

Return type: XML.

database_to_xmlschema(nulls boolean, tableforest boolean, targetns text)

Description: Maps a database table to an XML schema document.

Return type: XML.

database_to_xml_and_xmlschema(nulls boolean, tableforest boolean, targetns text)

Description: Maps database tables to XML values and schema documents.

Return type: XML.

Parameters for functions that map a table to XML are described as follows:

  • tbl: table name.
  • nulls: indicates whether null values are included in the output. If true, null values in columns are represented as <columnname xsi:nil="true"/>. If false, columns with null values are omitted from the output.
  • tableforest: If true, outputs an XML fragment. If false, outputs an XML document.
  • targetns: Specifies the desired XML namespace for the result. If not specified, passes an empty string.
  • query: SQL query statement.
  • cursor: cursor name.
  • count: amount of data obtained from the cursor.
  • schema: schema name.