The DBMS_XMLSCHEMA_ANNOTATE
package provides an interface to manage and configure the structured storage model, mainly through the use of pre-registration schema annotations.
See Also:
Oracle XML DB Developer's GuideThis chapter contains the following topics:
Overview
Security Model
The DBMS_XMLSCHEMA_ANNOTATE
package contains procedures to manage and configure the structured storage model, mainly through the use of pre-registration schema annotations. Schema annotations influence the way the XML data is stored. For example, the default table annotation assigns a user-provided name to an XML element instead of allowing the database to generate a system name. Consequently, query plans are more readable and it is easier to create constraints on that table.
Table 198-1 DBMS_XMLSCHEMA_ANNOTATE Package Subprograms
Subprogram | Description |
---|---|
Adds the XDB namespace required for XDB annotation |
|
Prevents the creation of a table for the top-level element by adding a default table attribute with an empty value to the element |
|
Sets the DOM fidelity attribute to |
|
Enables the creation of |
|
Sets the DOM fidelity attribute to |
|
Creates a document containing the differences between the annotated XML schema and the original XML schema |
|
Takes a XMLTABLE view definition on a xmltype column or table and it returns a |
|
Lets a user raise or suppress a warning if an annotation maps to zero nodes in the XML schema |
|
Removes the setting of the SQL type from the |
|
Removes any default table attribute given for the element. After calling this procedure, the system generates table names |
|
Removes all annotations used to maintain DOM from the given schema |
|
Removes any existing |
|
Removes a SQL collection type. |
|
Removes a |
|
Removes a SQL type |
|
Removes the SQL type mapping for the given schema type. |
|
Removes the table storage properties from the |
|
Removes he setting of the |
|
Assigns a SQL datatype to the |
|
Sets the name of the table for the specified global element |
|
Sets the |
|
Takes the annotated differences resulting from a call to |
|
Assigns a SQL type name for a collection |
|
Assigns a name to the SQL attribute that corresponds to an element defined in the XML schema |
|
Assigns a SQL type to a global object |
|
Defines a mapping of schema type and SQL type |
|
Specifies properties in the |
|
Sets the |
This procedure prevents the creation of a table for the top-level element by adding a default table attribute with an empty value to the element. The first overload applies to a specified top-level element and the second applies to all top-level elements. The procedure always overwrites. This is equivalent to using the schema annotation xdb:defaultTable=""
for the top-level element or elements.
DBMS_XMLSCHEMA_ANNOTATE.DISABLEDEFAULTTABLECREATION ( xmlschema IN OUT XMLType, globalElementName IN VARCHAR2);
DBMS_XMLSCHEMA_ANNOTATE.DISABLEDEFAULTTABLECREATION ( xmlschema IN OUT XMLType);
The purchaseOrder
element will have an annotation similar to xdb:defaultTable=""
.
DECLARE xml_schema XMLTYPE; BEGIN SELECT out INTO xml_schema FROM annotation_tab; DBMS_XMLSCHEMA_ANNOTATE.DISABLEDEFAULTTABLECREATION(xml_schema, 'purchaseOrder'); UPDATE annotation_tab SET out = xml_schema; END; /
This procedure sets the DOM fidelity attribute to FALSE
.
There are two overloads. The first sets DOM fidelity attribute to FALSE
for all complex types, and the second sets it to FALSE
for the named complex type. This is equivalent to adding xdb:maintainDOM="false"
on all or specified complex types respectively.
DBMS_XMLSCHEMA_ANNOTATE.DISABLEMAINTAINDOM ( xmlschema IN OUT XMLType, overwrite IN BOOLEAN default TRUE);
DBMS_XMLSCHEMA_ANNOTATE.DISABLEMAINTAINDOM ( xmlschema IN OUT XMLType, complexTypeName IN VARCHAR2, overwrite IN BOOLEAN default TRUE);
This procedure enables the creation of ALL top level tables by removing the empty default table name annotation.
DBMS_XMLSCHEMA_ANNOTATE.ENABLEDEFAULTTABLECREATION ( xmlschema IN OUT XMLTYPE); DBMS_XMLSCHEMA_ANNOTATE.ENABLEDEFAULTTABLECREATION ( xmlschema IN OUT XMLTYPE, globalElementName IN VARCHAR2););
This procedure sets the DOM fidelity attribute to TRUE
.
There are two overloads. The first sets DOM fidelity attribute to TRUE
for all complex types, and the second sets it to TRUE for the named complex type.
DBMS_XMLSCHEMA_ANNOTATE.ENABLEMAINTAINDOM ( xmlschema IN OUT XMLType, overwrite IN BOOLEAN default TRUE);
DBMS_XMLSCHEMA_ANNOTATE.ENABLEMAINTAINDOM ( xmlschema IN OUT XMLType, complexTypeName IN VARCHAR2, overwrite IN BOOLEAN default TRUE);
This function creates a document containing the differences between the annotated XML schema and the original XML schema.
This function saves all annotations in one document, named annotations
, and returns it. With this document, you can apply all annotations to a non-annotated schema, using DBMS_XMLSCHEMA_ANNOTATE.
GETSCHEMAANNOTATIONS
.
DBMS_XMLSCHEMA_ANNOTATE.GETSCHEMAANNOTATIONS
is not available on Oracle Database release 10.2 (only Oracle Database release 11.x).
See Also:
SETSCHEMAANNOTATATIONS ProcedureFor an example of DBMS_XMLSCHEMA_ANNOTATE.
GETSCHEMAANNOTATIONS
, see the example in SETSCHEMAANNOTATATIONS Procedure.
This function takes a XMLTABLE view definition on a xmltype column or table and it returns a CLOB
which can be used as parameter to create a structured xmlindex that backs up the XMLTABLE view as relational table.
This procedure lets a user raise or suppress a warning if an annotation maps to zero nodes in the XML schema.
This procedure removes the setting of the SQL type from the ANY
child of the complex type with the given name.
DBMS_XMLSCHEMA_ANNOTATE.REMOVEANYSTORAGE ( xmlschema IN OUT XMLType, complexTypeName IN VARCHAR2);
This procedure reverses the SETANYSTORAGE Procedure.
This procedure removes any default table attribute given for the element. After calling this procedure, the system generates table names. This procedure always overwrites.
DBMS_XMLSCHEMA_ANNOTATE.REMOVEDEFAULTTABLE ( xmlschema IN OUT XMLTYPE, globalElementName IN VARCHAR2);
Annotations can be verified anytime using "select out from annotation_tab"
.
--The purchaseOrder element will have no annotation for defaultTable. DECLARE xml_schema XMLTYPE; BEGIN SELECT out INTO xml_schema FROM annotation_tab; DBMS_XMLSCHEMA_ANNOTATE.REMOVEDEFAULTTABLE(xml_schema, 'purchaseOrder'); UPDATE annotation_tab SET out = xml_schema; END; /
This procedure removes all annotations used to maintain DOM from the given schema.
This procedure removes any existing SQLInline
attributes to prevent out-of-line storage. There are three overloads.
Removes the SQLInline
attribute for the named element.
DBMS_XMLSCHEMA_ANNOTATE.REMOVEOUTOFLINE ( xmlschema IN OUT XMLType, elementName IN VARCHAR2, elementType IN VARCHAR2, overwrite IN BOOLEAN default TRUE);
Removes the SQLInline
attribute for the object specified by its global object and local element names.
DBMS_XMLSCHEMA_ANNOTATE.REMOVEOUTOFLINE ( xmlschema IN OUT XMLType, globalObject IN VARCHAR2, globalObjectName IN VARCHAR2, localElementName IN VARCHAR2);
Removes the SQLInline
attribute for the referenced global element.
DBMS_XMLSCHEMA_ANNOTATE.REMOVEOUTOFLINE ( xmlschema IN OUT XMLType, reference IN VARCHAR2);
Table 198-13 REMOVEMAKEOUTOFLINE Procedure Parameters
Parameter | Description |
---|---|
|
The XML schema to be annotated |
|
The element name |
|
The element type |
|
The global object (global complex type or global element) |
|
The name of the global object |
|
The name of a local element that descends from the global element |
|
A reference to a global element |
|
A boolean that indicates whether or not the procedure overwrites element attributes. The default is |
This procedure reverses SETOUTOFLINE Procedure.
This procedure removes a SQL collection type. The first overload removes the SQL collection type corresponding to the named element and the second overload removes the type from the XML element inside the complex type.
DBMS_XMLSCHEMA_ANNOTATE.REMOVESQLCOLLTYPE ( xmlschema IN OUT XMLType, elementName IN VARCHAR2);
DBMS_XMLSCHEMA_ANNOTATE.REMOVESQLCOLLTYPE ( xmlschema IN OUT XMLType, globalObject IN VARCHAR2, globalName IN VARCHAR2, localElementName IN VARCHAR2);
Table 198-14 REMOVESQLCOLLTYPE Procedure Parameters
Parameter | Description |
---|---|
|
The XML schema to be annotated |
|
The element name |
|
The global object (global complex type or global element) |
|
The name of the global object |
|
The name of a local element that descends from the global element |
This procedure reverses the SETSQLCOLLTYPE Procedure.
This procedure removes a SQLNAME
from a global element.
DBMS_XMLSCHEMA_ANNOTATE.REMOVESQLNAME ( xmlschema IN OUT XMLType, globalObject IN VARCHAR2, globalObjectName IN VARCHAR2, localObject IN VARCHAR2, localObjectName IN VARCHAR2, sqlName IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
Table 198-15 REMOVESQLNAME Procedure Parameters
Parameter | Description |
---|---|
|
XML schema to be annotated |
|
Global object (global complex type or global element) |
|
Name of the global object |
|
Object descended from the global object |
|
Name of the local object |
|
Name of the SQL attribute that corresponds to the element defined in the XML schema |
|
Boolean that indicates whether or not the procedure overwrites element attributes. The default is |
The shipTo
element will have an annotation similar to xdb:SQLName="SHIPTO_SQLNAME"
.
DECLARE xml_schema XMLTYPE; BEGIN SELECT out INTO xml_schema FROM annotation_tab; DBMS_XMLSCHEMA_ANNOTATE.SETSQLNAME (xml_schema, 'element', 'purchaseOrder', 'element', 'shipTo', 'SHIPTO_SQLNAME'); UPDATE annotation_tab SET out = xml_schema; END; /
This procedure removes a SQL type. The first overload removes a SQL type from a global element and the second overload removes the type from a global element inside the complex type.
DBMS_XMLSCHEMA_ANNOTATE.REMOVESQLTYPE ( xmlschema in out XMLType, globalElementName IN VARCHAR2);
DBMS_XMLSCHEMA_ANNOTATE.REMOVESQLTYPE ( xmlschema IN OUT XMLTYPE, globalObject IN VARCHAR2, globalObjectName IN VARCHAR2, localObject IN VARCHAR2, localObjectName IN VARCHAR2);
Table 198-16 REMOVESQLTYPE Procedure Parameters
Parameter | Description |
---|---|
|
XML schema to be annotated. |
|
Global object (global complex type or global element) |
|
Name of the global element. |
|
Name of the global object |
|
Object descended from the global object |
|
Name of the local object |
This procedure reverses the SETSQLTYPE Procedure.
This procedure removes the SQL type mapping for the given schema type.
DBMS_XMLSCHEMA_ANNOTATE.REMOVESQLTYPEMAPPING ( xmlschema IN OUT XMLTYPE, schemaTypeName IN VARCHAR2);
This procedure reverses the SETSQLTYPEMAPPING Procedure.
This procedure removes the table storage properties from the CREATE
TABLE
statement. This procedure is overloaded. Each overload has different parameter requirements as indicated.
DBMS_XMLSCHEMA_ANNOTATE.REMOVETABLEPROPS ( xmlschema IN OUT XMLTYPE, globalElementName IN VARCHAR2);
DBMS_XMLSCHEMA_ANNOTATE.REMOVETABLEPROPS ( xmlschema IN OUT XMLTYPE, globalObject IN VARCHAR2, globalObjectName IN VARCHAR2, localElementName IN VARCHAR2);
Table 198-18 REMOVETABLEPROPS Procedure Parameters
Parameter | Description |
---|---|
|
XML schema to be annotated |
|
Name of the global element in the schema |
|
Global object (global complex type or global element) |
|
Name of the global object |
|
Name of a local element that descends from the global element |
This procedure reverses the SETTABLEPROPS Procedure.
This procedure removes the setting of the TimeStampWithTimeZone
datatype from all dateTime
typed elements in the XML schema.
DBMS_XMLSCHEMA_ANNOTATE.REMOVETIMESTAMPWITHTIMEZONE ( xmlschema IN OUT XMLTYPE); DBMS_XMLSCHEMA_ANNOTATE.REMOVETIMESTAMPWITHTIMEZONE ( xmlschema IN OUT XMLTYPE, schemaTypeName IN VARCHAR2);
This procedure reverses the SETTIMESTAMPWITHTIMEZONE Procedure.
This procedure assigns a SQL datatype to the ANY
child of the complex type with the given name.
DBMS_XMLSCHEMA_ANNOTATE.SETANYSTORAGE ) xmlschema IN OUT XMLType, complexTypeName IN VARCHAR2, sqlTypeName IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
The xsd:any
child
of complex type Items
is assigned an annotation similar to xdb:SQLType="VARCHAR"
.
DECLARE xml_schema XMLTYPE;BEGIN SELECT out INTO xml_schema FROM annotation_tab; DBMS_XMLSCHEMA_ANNOTATE.setAnyStorage (xml_schema, 'Items', 'VARCHAR'); UPDATE annotation_tab SET out = xml_schema;END; /
This procedure sets the name of the table for the specified global element. This is equivalent to using the schema annotation xdb:defaultTable="<default_table_name>"
for the top-level element.
DBMS_XMLSCHEMA_ANNOTATE.SETDEFAULTTABLE ( xmlschema IN OUT XMLTYPE, globalElementName IN VARCHAR2, tableName IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
Table 198-21 SETDEFAULTTABLE Procedure Parameters
Parameter | Description |
---|---|
|
XML schema to be annotated |
|
Name of the global element in the schema |
|
Name being assigned to the table |
|
Boolean that indicates whether or not the procedure overwrites element attributes. The default is |
This procedure sets the SQLInline
attribute to FALSE
, that is, it sets xdb:SQLInLine=FALSE
.
This forces XDB to store the corresponding elements in the XML document out-of-line as rows in a separate XMLType
table. XDB stores references to each row of the XMLType
table in a link table that is maintained by the main table
This procedure can improve performance in some situations if the out-of-line table acts as the driver for the query. Storing elements in an out-of-line table also reduces the numbers of columns in the base table, thus avoiding '1000 column limit'
errors during XML schema registration, when some elements have complex types with many elements.
Also See:
Oracle XML DB Developer's GuideThere are three overloads.
Sets the SQLInline
attribute to FALSE
, forcing out-of-line storage for the named element.
DBMS_XMLSCHEMA_ANNOTATE.SETOUTOFLINE ( xmlschema IN OUT XMLType, elementName IN VARCHAR2, elementType IN VARCHAR2, defaultTableName IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
Sets the SQLInline
attribute to FALSE
, forcing out-of-line storage for the element specified by its local and global name.
DBMS_XMLSCHEMA_ANNOTATE.SETOUTOFLINE ( xmlschema IN OUT XMLType, globalObject IN VARCHAR2, globalObjectName IN VARCHAR2, localElementName IN VARCHAR2, defaultTableName IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
Sets the SQLInline
attribute to FALSE
to force out-of-line storage and sets the default table name for all references to a particular global element.
DBMS_XMLSCHEMA_ANNOTATE.SETOUTOFLINE ( xmlschema IN OUT XMLType, reference IN VARCHAR2, defaultTableName IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
Table 198-22 SETOUTOFLINE Procedure Parameters
Parameter | Description |
---|---|
|
The XML schema to be annotated. |
|
The element name |
|
The element type |
|
The name of the default table. |
|
The global object (global complex type or global element) |
|
The name of the global object |
|
The name of a local element that descends from the global element. |
|
A reference to a global element |
|
A boolean that indicates whether or not the procedure overwrites element attributes. The default is |
After XML schema registration and before loading XML instance data, use DBMS_XMLSTORAGE_MANAGE.SCOPEXMLREFERENCES()
to make these references scope to the out-of-line table only. This ensures better query performance later on.
The following example illustrates the third overloaded method. The element comment will have an annotation similar to xdb:defaultTable="CMMNT_DEFAULT_TABLE"
DECLARE xml_schema xmltype; BEGIN SELECT OUT INTO xml_schema FROM annotation_tab; DBMS_XMLSCHEMA_ANNOTATE.SETOUTOFLINE (xml_schema, 'ipo:comment', 'CMMNT_DEFAULT_TABLE'); UPDATE annotation_tab SET OUT = xml_schema; END; /
This procedure takes the annotated differences resulting from a call to DBMS_XMLSCHEMA_ANNOTATE.
GETSCHEMAANNOTATIONS
and patches them into the provided XML schema.
DBMS_XMLSCHEMA_ANNOTATE.SETSCHEMAANNOTATIONS ( xmlschema IN OUT xmlType, annotations IN VARCHAR2);
DBMS_XMLSCHEMA_ANNOTATE.SETSCHEMAANNOTATATIONS
is not available on Oracle Database release 10.2 (only Oracle Database release 11.x).
See Also:
GETSCHEMAANNOTATIONS FunctionThe following example illustrates DBMS_XMLSCHEMA_ANNOTATE.SETSCHEMAANNOTATIONS
shown here and GETSCHEMAANNOTATIONS Function.
-- test getannotations and apply them declare xml_schema xmltype; xml_schema2 xmltype; annotations xmltype; begin select out into xml_schema from annotation_tab; -- get the annotations from the schema annotations := DBMS_XMLSCHEMA_ANNOTATE.getSchemaAnnotations (xml_schema); -- apply the annotations to the schema select inp into xml_schema2 from annotation_tab; DBMS_XMLSCHEMA_ANNOTATE.setSchemaAnnotations(xml_schema2, annotations); update annotation_tab t set t.out = xml_schema2; end; /
This procedure assigns a SQL type name for a collection. A collection is a global or local element with maxOccurs>1
. Using this procedure, XDB creates SQLType
s with the user-defined names provided.
There are two overloads. The first sets the name of the SQL collection type corresponding to an XML element and the second to an XML element inside the specified complex type.
DBMS_XMLSCHEMA_ANNOTATE.SETSQLCOLLTYPE ( xmlschema IN OUT XMLTYPE, elementName IN VARCHAR2, sqlCollType IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
DBMS_XMLSCHEMA_ANNOTATE.SETSQLCOLLTYPE ( xmlschema IN OUT XMLType, globalObject IN VARCHAR2, globalObjectName IN VARCHAR2, localElementName IN VARCHAR2, sqlCollType IN VARCHAR2, overwrite IN BOOLEAN default TRUE );
Table 198-24 SETSQLCOLLTYPE Procedure Parameters
Parameter | Description |
---|---|
|
The XML schema to be annotated |
|
The element name |
|
The SQL collection type |
|
The global object (global complex type or global element) |
|
The name of the global object |
|
The name of a local element that descends from the global element |
|
A boolean that indicates whether or not the procedure overwrites element attributes. The default is |
The item
element will have an annotation similar to xdb:SQLCollType="ITEM_SQL_COL_TYPE"
.
declare xml_schema xmltype; begin SELECT out INTO xml_schema FROM annotation_tab; DBMS_XMLSCHEMA_ANNOTATE.setSQLCollType (xml_schema, 'item', 'ITEM_SQL_COL_TYPE',TRUE); UPDATE annotation_tab SET out = xml_schema; end;
This procedure assigns a name to the SQL attribute that corresponds to an element defined in the XML schema.
DBMS_XMLSCHEMA_ANNOTATE.SETSQLNAME ( xmlschema IN OUT XMLType, globalObject IN VARCHAR2, globalObjectName IN VARCHAR2, localObject IN VARCHAR2, localObjectName IN VARCHAR2, sqlName IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
Table 198-25 SETSQLNAME Procedure Parameters
Parameter | Description |
---|---|
|
XML schema to be annotated |
|
Global object (global complex type or global element) |
|
Name of the global object |
|
Object descended from the global object |
|
Name of the local object |
|
Name of the SQL attribute that corresponds to the element defined in the XML schema |
|
Boolean that indicates whether or not the procedure overwrites element attributes. The default is |
The shipTo
element will have an annotation similar to xdb:SQLName="SHIPTO_SQLNAME"
.
DECLARE xml_schema XMLTYPE; BEGIN SELECT out INTO xml_schema FROM annotation_tab; DBMS_XMLSCHEMA_ANNOTATE.SETSQLNAME (xml_schema, 'element', 'purchaseOrder', 'element', 'shipTo', 'SHIPTO_SQLNAME'); UPDATE annotation_tab SET out = xml_schema; END; /
This procedure assigns a SQL type to a global object.
There are two overloads. The first overload assigns a SQL Type to a global object, such as a global element or global complex type and the second to a local object.
DBMS_XMLSCHEMA_ANNOTATE.SETSQLTYPE ( xmlschema IN OUT XMLTYPE, globalElementName IN VARCHAR2, sqlType IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
DBMS_XMLSCHEMA_ANNOTATE.SETSQLTYPE ( xmlschema IN OUT XMLTYPE, globalObject IN VARCHAR2, globalObjectName IN VARCHAR2, localObject IN VARCHAR2, localObjectName IN VARCHAR2, sqlType IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
Table 198-26 SETSQLTYPE Procedure Parameters
Parameter | Description |
---|---|
|
XML schema to be annotated |
|
Global object (global complex type or global element) |
|
Name of the global object |
|
Name of the global element |
|
Object descended from the global object |
|
Name of the local object |
|
SQL type assigned to the named global element |
|
Boolean that indicates whether or not the procedure overwrites element attributes. The default is |
The purchaseOrder
element will have an annotation similar to xdb:SQLType="PO_SQLTYPE"
and the shipTo
element has one similar to xdb:SQLType="VARCHAR"
.
DECLARE xml_schema xmltype; BEGIN SELECT out INTO xml_schema FROM annotation_tab; DBMS_XMLSCHEMA_ANNOTATE.setSQLType (xml_schema, 'purchaseOrder', 'PO_SQLTYPE'); UPDATE annotation_tab SET out = xml_schema; END; / DECLARE xml_schema xmltype;BEGIN SELECT out INTO xml_schema FROM annotation_tab; DBMS_XMLSCHEMA_ANNOTATE.setSQLType (xml_schema, 'element','purchaseOrder', 'element' ,'shipTo', 'VARCHAR'); UPDATE annotation_tab SET out = xml_schema;END; /
This procedure defines a mapping of schema type and SQL type.
If you use this procedure, you do not need to call the SETSQLTYPE
procedure on all instances of the schema type; instead the procedure traverses the schema and assigns the SQL type automatically.
DBMS_XMLSCHEMA_ANNOTATE.SETSQLTYPEMAPPING ( xmlschema IN OUT XMLType, schemaTypeName IN VARCHAR2, sqlTypeName IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
This procedure specifies properties in the TABLE
storage clause that is appended to the default CREATE
TABLE
statement. There are two overloads with different parameter requirements, as indicated:
DBMS_XMLSCHEMA_ANNOTATE.SETTABLEPROPS ( xmlschema IN OUT XMLType, globalElementName IN VARCHAR2, tableProps IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
DBMS_XMLSCHEMA_ANNOTATE.SETTABLEPROPS ( xmlschema IN OUT XMLTYPE, globalObject IN VARCHAR2, globalObjectName IN VARCHAR2, localElementName IN VARCHAR2, tableProps IN VARCHAR2, overwrite IN BOOLEAN DEFAULT TRUE);
Table 198-28 SETTABLEPROPS Procedure Parameters
Parameter | Description |
---|---|
|
XML schema to be annotated |
|
Name of the global element in the schema |
|
Table properties |
|
Global object (global complex type or global element) |
|
Name of the global object |
|
Name of a local element that descends from the global element |
|
Boolean that indicates whether or not the procedure overwrites element attributes. The default is |
The purchaseOrder
element will have an annotation similar to xdb:tableProps="CACHE"
.
DECLARE xml_schema XMLTYPE;BEGIN SELECT out INTO xml_schema FROM annotation_tab; DBMS_XMLSCHEMA_ANNOTATE.SETTABLEPROPS(xml_schema, 'purchaseOrder' ,'CACHE'); UPDATE annotation_tab SET out = xml_schema;END; /
This procedure sets the TIMESTAMPWITHTIMEZONE
datatype to all dateTime
typed elements in the XML schema. This is equivalent to adding xdb:SQLType="TIMESTAMP WITH TIME ZONE"
to all dateTime
objects.
DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE ( xmlschema IN OUT XMLTYPE, overwrite IN BOOLEAN DEFAULT TRUE);