cursor_to_xmlschema()

一个返回cursor_to_xml()映射的XML Schema的函数

cursor_to_xmlschema() 是一个系统函数,它返回一个XML Schema文档,该文档描述了由 cursor_to_xml() 执行的映射。

cursor_to_xmlschema()PostgreSQL 8.3 中被添加。

用法

cursor_to_xmlschema ( table regclass, nulls boolean, tableforest boolean, targetns text )
         → xml

当提供与调用 cursor_to_xml() 完全相同的参数时,table_to_xmlschema() 将返回相应的XML Schema文档。

变更历史

示例

cursor_to_xmlschema() 的基本用法示例

postgres=# BEGIN;
BEGIN

postgres=*# DECLARE foo_cursor CURSOR
                FOR SELECT * FROM foo;
DECLARE CURSOR

postgres=*# SELECT * FROM cursor_to_xmlschema('foo_cursor', false, true,'');
                                     cursor_to_xmlschema
----------------------------------------------------------------------------------------------
 <xsd:schema                                                                                 +
     xmlns:xsd="http://www.w3.org/2001/XMLSchema">                                           +
                                                                                             +
 <xsd:simpleType name="INTEGER">                                                             +
   <xsd:restriction base="xsd:int">                                                          +
     <xsd:maxInclusive value="2147483647"/>                                                  +
     <xsd:minInclusive value="-2147483648"/>                                                 +
   </xsd:restriction>                                                                        +
 </xsd:simpleType>                                                                           +
                                                                                             +
 <xsd:simpleType name="UDT.postgres.pg_catalog.text">                                        +
   <xsd:restriction base="xsd:string">                                                       +
   </xsd:restriction>                                                                        +
 </xsd:simpleType>                                                                           +
                                                                                             +
 <xsd:complexType name="RowType">                                                            +
   <xsd:sequence>                                                                            +
     <xsd:element name="id" type="INTEGER" minOccurs="0"></xsd:element>                      +
     <xsd:element name="val" type="UDT.postgres.pg_catalog.text" minOccurs="0"></xsd:element>+
     <xsd:element name="x" type="INTEGER" minOccurs="0"></xsd:element>                       +
   </xsd:sequence>                                                                           +
 </xsd:complexType>                                                                          +
                                                                                             +
 <xsd:element name="row" type="RowType"/>                                                    +
                                                                                             +
 </xsd:schema>
(1 row)

分类

游标, 系统函数, XML

另请参阅

cursor_to_xml(), query_to_xmlschema(), table_to_xmlschema(), database_to_xmlschema(), schema_to_xmlschema()

反馈

请在此提交关于“cursor_to_xmlschema()”的任何评论、建议或更正 这里