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: Use 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.

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 diagramSkip visual syntax diagram CALL SYSPROC . XSR_REGISTER ( rschemaNULL , nameNULL , 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 and output parameter of type VARCHAR(128) that specifies the name of the XML schema. The complete SQL identifier 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. 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 be an XML document or a null value.

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)