XSR_REGISTER stored procedure

The XSR_REGISTER procedure is the first stored procedure to be called as part of the XML schema registration process, which registers XML schemas with the XSR.

The user that calls this stored procedure is considered the creator of this XML schema. DB2® obtains the namespace attribute from the schema document when XSR_COMPLETE is invoked.

Environment for XSR_REGISTER

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

Recommendation: Start of changeUse WLM environment DSNWLM_XML for running XSR_REGISTER. The startup procedure for this environment, DSNWLMX, can be configured during installation, using installation panel DSNTIPRJ, XML schema processing routines.End of change

Authorization required for XSR_REGISTER

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

XSR_REGISTER syntax diagram

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

Read syntax diagram
         .-SYSPROC-.                                       
>>-CALL--+---------+--.--XSR_REGISTER--(--+-rschema-+--,-------->
                                          '-NULL----'      

>--+-name-+--,--+-schemalocation-+--,--content--,--------------->
   '-NULL-'     '-NULL-----------'                  

>--+-docproperty-+--)------------------------------------------><
   '-NULL--------'      

XSR_REGISTER option descriptions

rschema
An input argument of type VARCHAR(128) that specifies the SQL schema for the XML schema. If a value is specified, it must be SYSXSR. Rules for valid characters and delimiters that apply to any SQL identifier also apply to this argument.
name
An input and output argument of type VARCHAR(128) that specifies the name of the XML schema. The complete SQL identifier for the XML schema is "rschema.name" and should be unique among all objects in the XSR. This argument accepts a NULL value. When a NULL value is provided for this argument, 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 this argument.
schemalocation
An input argument of type VARCHAR(1000), which can have a NULL value, that indicates the schema location of the primary XML schema document. 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.
content
An input parameter of type BLOB(30M) that contains the content of the primary XML schema document. 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 primary XML schema document. This parameter can have a NULL value; otherwise, the value is an XML document.

Example of XSR_REGISTER

The following example calls the XSR_REGISTER stored procedure:

   CALL SYSPROC.XSR_REGISTER(
     'SYSXSR',
     'POschema',
     'http://myPOschema/PO.xsd',
     :content_host_var,
     :docproperty_host_var)

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

   CALL SYSPROC.XSR_REGISTER(
     'SYSXSR',
     '"POschema"',
     'http://myPOschema/PO.xsd',
     :content_host_var,
     :docproperty_host_var)