XSR_ADDSCHEMADOC stored procedure

The XSR_ADDSCHEMADOC stored procedure adds every XML schema, other than the primary XML schema document, to the XSR.

Each XML schema in the XSR can consist of one or more XML schema documents. When an XML schema consists of multiple documents, you need to call XSR_ADDSCHEMADOC for the additional documents.

Environment for XSR_ADDSCHEMADOC

XSR_ADDSCHEMADOC runs in a WLM-established stored procedures address space.

Recommendation: Use WLM environment DSNWLM_XML for running XSR_ADDSCHEMADOC. The startup procedure for this environment, DSNWLMX, can be configured during installation, using installation panel DSNTIPRJ, XML schema processing routines.

Authorization required for XSR_ADDSCHEMADOC

The user ID of the caller of the procedure must have the EXECUTE privilege on the XSR_ADDSCHEMADOC stored procedure.

XSR_ADDSCHEMADOC syntax diagram

The following syntax diagram shows the CALL statement for invoking XSR_ADDSCHEMADOC.

Read syntax diagramSkip visual syntax diagram CALL SYSPROC . XSR_ADDSCHEMADOC ( rschemaNULL , name , schemalocationNULL , content , docpropertyNULL )
rschema
An input parameter of type VARCHAR (128) that specifies the SQL schema part of the qualified name that identifies the XML schema in the XSR. If a non-null value is specified, it must be SYSXSR. If rschema is a null value, the default SQL schema SYSXSR is used.
name

An input parameter of type VARCHAR(128) that specifies the name of the XML schema. The complete qualified name for the XML schema is rschema.name, and it should be unique among all objects in the XSR. If a null value is specified, a unique value is generated and stored within the XSR. Rules for valid characters and delimiters that apply to any SQL identifier also apply to name

schemalocation
An input parameter of type VARCHAR(1000), which can have a null value, that indicates the schema location of the primary XML schema document to which the XML schema document is being added. This argument is the external name of the XML schema, that is, the primary document can be identified in the XML instance documents with the xsi:schemaLocation attribute. The document that references the schemalocation must use valid a URI format.
content
An input parameter of type BLOB(30M) that contains the content of the XML schema document being added. This argument cannot have a null value. An XML schema document must be supplied. The content of the XML schema document must be encoded in Unicode.
docproperty
An input parameter of type BLOB(5M) that indicates the properties for the XML schema document being added. This parameter can be an XML document or a null value.

Example of XSR_ADDSCHEMADOC

The following example calls the XSR_ADDSCHEMADOC stored procedure:
CALL SYSPROC.XSR_ADDSCHEMADOC(
     'SYSXSR',
     'POschema',
     'http://myPOschema/PO.xsd',
     :schema_content,
     :schema_properties)

In this example, XSR_ADDSCHEMADOC folds the name POschema to uppercase, so the name of the XML schema that is added is POSCHEMA. If you do not want XSR_ADDSCHEMADOC to fold POschema to uppercase, you need to delimit the name with double quotation marks ("), as in the following example.

CALL SYSPROC.XSR_ADDSCHEMADOC(
     'SYSXSR',
     '"POschema"',
     'http://myPOschema/PO.xsd',
     :schema_content,
     :schema_properties)