XSR_EXTENTITY procedure
The XSR_EXTENTITY procedure registers an external entity with the XML schema repository (XSR).
The schema is SYSPROC.
Authorization
The authorization ID of the
caller of the procedure must have at least one of the following:
- DBADM authority.
- IMPLICIT_SCHEMA database authority if the SQL schema does not exist.
- CREATEIN privilege if the SQL schema exists.
-
rschema
- An input and output argument of type VARCHAR (128) that specifies the SQL schema for the external entity. The SQL schema is one part of the SQL identifier used to identify this external entity in the XSR. (The other part of the SQL identifier is supplied by the name argument.) This argument can have a null value, which indicates that the default SQL schema, as defined in the CURRENT SCHEMA special register, is used. Rules for valid characters and delimiters that apply to any SQL identifier also apply to this argument. Relational schemas that begin with the string 'SYS' must not be used for this value. XSR objects will not experience name collisions with database objects that exist outside of the XSR, because XSR objects occur in a different namespace than objects outside of the XML schema repository. name
- An input and output argument of type VARCHAR (128) that specifies the name of the external entity. The complete SQL identifier for the external entity 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. systemid
- An input parameter of type VARCHAR (1000) that specifies the system identifier of the external entity. The system ID of the external entity should match the uniform resource identifier of the external entity in the ENTITY declaration (as prefixed by the SYSTEM keyword, if used). This argument cannot have a null value. The system ID can be specified together with a public ID. publicid
- An input parameter of type VARCHAR (1000) that specifies the public identifier of the external entity. The public ID of a external entity should match the uniform resource identifier of the external entity in the ENTITY declaration (as prefixed by the PUBLIC keyword, if used). This argument accepts a null value and should be used only if also specified in the DOCTYPE declaration of the XML instance document or in an ENTITY declaration. content
- An input parameter of type BLOB (30M) that contains the content of the external entity document. This argument cannot have a null value.
Example
Register the external entities identified by the system identifiers http://www.test.com/food/chocolate.txt and http://www.test.com/food/cookie.txt:
CALL SYSPROC.XSR_EXTENTITY ( 'FOOD' ,
'CHOCLATE' ,
'http://www.test.com/food/chocolate.txt' ,
NULL ,
:content_of_chocolate.txt_as_a_host_variable
)
CALL SYSPROC.XSR_EXTENTITY ( 'FOOD' ,
'COOKIE' ,
'http://www.test.com/food/cookie.txt' ,
NULL ,
:content_of_cookie.txt_as_a_host_variable
)