DATABASE_TO_XMLSCHEMA

说明

该函数用于将数据库的表映射为XML模式文档,返回值为XML类型。(兼容PostgreSQL)

语法

database_to_xmlschema ::=

参数

bool_nulls

该参数决定是否在结果中展开null值。

bool_tableforest

  • true:输出xml片段。
  • false:输出xml文档。

text_targetns

指定想要结果的XML命名空间。若不指定,应传递一个空字符串。

示例

SQL> select DATABASE_TO_XMLSCHEMA(true, true, 'a');
                                       DATABASE_TO_XMLSCHEMA
---------------------------------------------------------------------------------------------------
 <xsd:schema
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     targetNamespace="a"
     elementFormDefault="qualified">

 <xsd:simpleType name="INTEGER">
   <xsd:restriction base="xsd:int">
     <xsd:maxInclusive value="2147483647"/>
     <xsd:minInclusive value="-2147483648"/>
   </xsd:restriction>
 </xsd:simpleType>

 <xsd:simpleType name="VARCHAR">
   <xsd:restriction base="xsd:string">
   </xsd:restriction>
 </xsd:simpleType>

 <xsd:simpleType name="TIMESTAMP">
   <xsd:restriction base="xsd:dateTime">
     <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/>
   </xsd:restriction>
 </xsd:simpleType>

 <xsd:simpleType name="BIGINT">
   <xsd:restriction base="xsd:long">
     <xsd:maxInclusive value="9223372036854775807"/>
     <xsd:minInclusive value="-9223372036854775808"/>
   </xsd:restriction>
 </xsd:simpleType>

 <xsd:simpleType name="UDT.OSRDB.INFO_SCHEM.BINARY">
 </xsd:simpleType>

 <xsd:simpleType name="NUMERIC">
 </xsd:simpleType>

 <xsd:simpleType name="DATE">
   <xsd:restriction base="xsd:date">
     <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}"/>
   </xsd:restriction>
 </xsd:simpleType>

 <xsd:simpleType name="UDT.OSRDB.INFO_SCHEM.AQ_x0024__AGENT">
 </xsd:simpleType>

 <xsd:complexType name="CatalogType.OSRDB">
   <xsd:all>
     <xsd:element name="DIRECTORIES" type="SchemaType.OSRDB.DIRECTORIES"/>
     <xsd:element name="PUBLIC" type="SchemaType.OSRDB.PUBLIC"/>
     <xsd:element name="REPLICATION" type="SchemaType.OSRDB.REPLICATION"/>
     <xsd:element name="STAGENT" type="SchemaType.OSRDB.STAGENT"/>
     <xsd:element name="SYSDBA" type="SchemaType.OSRDB.SYSDBA"/>
     <xsd:element name="SYSFTSDBA" type="SchemaType.OSRDB.SYSFTSDBA"/>
     <xsd:element name="WMSYS" type="SchemaType.OSRDB.WMSYS"/>
   </xsd:all>
 </xsd:complexType>

 <xsd:element name="OSRDB" type="CatalogType.OSRDB"/>

 </xsd:schema>
(1 row)