UPDATE XMLSCHEMA command

The UPDATE XMLSCHEMA updates one XML schema with another in the XML schema repository (XSR).

Authorization

One of the following authorities:
  • DBADM
  • SELECT or SELECTIN privilege on the catalog views SYSCAT.XSROBJECTS and SYSCAT.XSROBJECTCOMPONENTS and one of the following sets of privileges:
    • SCHEMAADM privilege on the XML schema to be updated and SCHEMAADM privilege on the new XML schema, if the DROP NEW SCHEMA option is specified.
    • ALTERIN privilege on the XML schema to be updated and DROPIN privilege on the new XML schema, if the DROP NEW SCHEMA option is specified.
    • OWNER of the XML schema specified by xmlschema1.

Required connection

Database

Command syntax

Read syntax diagramSkip visual syntax diagramUPDATE XMLSCHEMAxmlschema1WITHxmlschema2DROP NEW SCHEMA

Command parameters

UPDATE XMLSCHEMA xmlschema1
Specifies the SQL identifier for the original XML schema to be updated.
WITH xmlschema2
Specifies the SQL identifier for the new XML schema that will be used to update the original XML schema.
DROP NEW SCHEMA
Indicates that the new XML schema should be dropped after it is used to update the original XML schema.

Example

UPDATE XMLSCHEMA JOHNDOE.OLDPROD
WITH JOHNDOE.NEWPROD
DROP NEW SCHEMA

The contents of the XML schema JOHNDOE.OLDPROD is updated with the contents of JOHNDOE.NEWPROD, and the XML schema JOHNDOE.NEWPROD is dropped.

Usage notes

  • The original and new XML schema must be compatible. For details about the compatibility requirements, see Compatibility requirements for evolving an XML schema.
  • Before an XML schema can be updated, both the original an the new schema must be registered in the XML schema repository (XSR).