
# 将表映射到XML
#### table_to_xml(tbl regclass, nulls boolean, tableforest boolean, targetns text)
描述：把表的内容映射成XML值。
返回值类型：xml
#### table_to_xmlschema(tbl regclass, nulls boolean, tableforest boolean, targetns text)
描述：把关系表的模式映射成XML模式文档。
返回值类型：xml
#### table_to_xml_and_xmlschema(tbl regclass, nulls boolean, tableforest boolean, targetns text)
描述：把关系表映射成XML值和模式文档。
返回值类型：xml
#### query_to_xml(query text, nulls boolean, tableforest boolean, targetns text)
描述：把SQL查询的内容映射成XML值。
返回值类型：xml
#### query_to_xmlschema(query text, nulls boolean, tableforest boolean, targetns text)
描述：把SQL查询映射成XML模式文档。
返回值类型：xml
#### query_to_xml_and_xmlschema(query text, nulls boolean, tableforest boolean, targetns text)
描述：把SQL查询映射成XML值和模式文档。
返回值类型：xml
#### cursor_to_xml(cursor refcursor, count int, nulls boolean, tableforest boolean, targetns text)
描述：把游标查询映射成XML值。
返回值类型：xml
#### cursor_to_xmlschema(cursor refcursor, nulls boolean, tableforest boolean, targetns text)
描述：把游标查询映射成XML模式文档。
返回值类型：xml
#### schema_to_xml(schema name, nulls boolean, tableforest boolean, targetns text)
描述：把模式中的表映射成XML值。
返回值类型：xml
#### schema_to_xmlschema(schema name, nulls boolean, tableforest boolean, targetns text)
描述：把模式中的表映射成XML模式文档
返回值类型：xml
#### schema_to_xml_and_xmlschema(schema name, nulls boolean, tableforest boolean, targetns text)
描述：把模式中的表映射成XML值和模式文档。
返回值类型：xml
#### database_to_xml(nulls boolean, tableforest boolean, targetns text)
描述：把数据库的表映射成XML值。
返回值类型：xml
#### database_to_xmlschema(nulls boolean, tableforest boolean, targetns text)
描述：把数据库的表映射成XML模式文档
返回值类型：xml
#### database_to_xml_and_xmlschema(nulls boolean, tableforest boolean, targetns text)
描述：把数据库的表映射成XML值和模式文档。
返回值类型：xml
![](https://support.huaweicloud.com/sqlreference-911-dws/public_sys-resources/note_3.0-zh-cn.png)
将表映射到XML有关函数的参数说明如下：
- tbl：表名。
- nulls：在输出中是否包含空值，若为true，列中的空值表示为：\<columnname xsi:nil="true"/\>，若为false，包含空值的列会从输出中省略。
- tableforest：若为true，则输出xml片段，false，输出xml文档。
- targetns：指定想要结果的XML命名空间。若不指定，应传递一个空字符串。
- query：SQL查询语句。
- cursor：游标名。
- count：从游标中获取的数据量。
- schema：模式名
 
