192 DBMS_XDBRESOURCE
The DBMS_XDBRESOURCE
package provides the interface to operate on the resource's metadata and contents.
This chapter contains the following topics:
See Also:
Oracle XML DB Developer's Guide for examples of "Using DBMS_XDBRESOURCE
"
192.1 DBMS_XDBRESOURCE Overview
The DBMS_XDBRESOURCE
package provides routines to get and set the resource's metadata and contents. To take advantage of the DOM traversal facility, provided in DBMS_XMLDOM
package, an XDBResource
instance could be converted to a DOMDocument
type by using DBMS_XDBRESOURCE
.MAKEDOCUMENT
routine.
192.2 DBMS_XDBRESOURCE Security Model
Owned by XDB
, the DBMS_XDBRESOURCE
package must be created by SYS
or XDB
. The EXECUTE
privilege is granted to PUBLIC
. Subprograms in this package are executed using the privileges of the current user.
192.3 Summary of DBMS_XDBRESOURCE Subprograms
This table lists the DBMS_XDBRESOURCE
subprograms and briefly describes them.
Table 192-1 DBMS_XDBRESOURCE Package Subprograms
Subprogram | Description |
---|---|
Frees any memory associated with an XDBResource |
|
Given an XDBResource, returns its ACL as string |
|
Returns the ACL Document for the given resource as |
|
Given an XDBResource, returns its author |
|
Given an XDBResource, returns its character set |
|
Given an XDBResource, returns its comment |
|
Returns the contents of the resource as a |
|
Returns the contents of the resource as a |
|
Returns the contents of the resource as an |
|
Given an XDBResource, returns its content-type |
|
Returns the contents of the resource as XML |
|
Returns the contents of the resource as a string |
|
Given an XDBResource, returns its creation date |
|
Given an XDBResource, returns its creator |
|
Returns the requested custom metadata given the xpath and namespace to the metadata |
|
Given an XDBResource, returns its display name |
|
Given an XDBResource, returns its language |
|
Given an XDBResource, returns its last modifier |
|
Given an XDBResource, returns its modification date |
|
Given an XDBResource, returns its owner. |
|
Given an XDBResource, returns its reference count |
|
Given an XDBResource, returns its version ID. |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Converts the XDBResource to a DOMDocument which can be operated on using the XMLDOM interface |
|
Updates the resource with any modifications |
|
Sets the ACL of the given XDBResource to the path specified |
|
Sets the author of the given XDBResource to the specified string |
|
Sets the character set of the given XDBResource to a specified character set |
|
Sets a comment associated with the given XDBResource |
|
Replaces the contents of the given resource with the given |
|
Sets the content-type of the given XDBResource |
|
Sets the custom metadata specified by the XPath and namespace to new data |
|
Sets the display name of the given XDBResource |
|
Sets the language of the given XDBResource |
|
Sets the owner of the given XDBResource |
192.3.1 FREERESOURCE Procedure
This procedure frees any memory associated with an XDBResource.
Syntax
DBMS_XDBRESOURCE.FREERESOURCE ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-2 FREERESOURCE Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource to free |
192.3.2 GETACL Function
Given an XDBResource, this function returns its ACL as string.
Syntax
DBMS_XDBRESOURCE.GETACL ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-3 GETACL Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.3 GETACLDOCFROMRES Function
This function returns the ACL Document for the given resource as XMLType
.
Syntax
DBMS_XDBRESOURCE.GETACLDOCFROMRES ( res IN XDBResource) RETURN SYS.XMLTYPE;
Parameters
Table 192-4 GETACLDOCFROMRES Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.4 GETAUTHOR Function
Given an XDBResource, this function returns its author.
Syntax
DBMS_XDBRESOURCE.GETAUTHOR ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-5 GETAUTHOR Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.5 GETCHARACTERSET Function
Given an XDBResource, this function returns its characterset.
Syntax
DBMS_XDBRESOURCE.GETCHARACTERSET ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-6 GETCHARACTERSET Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.6 GETCOMMENT Function
Given an XDBResource, this function returns its comment.
Syntax
DBMS_XDBRESOURCE.GETCOMMENT ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-7 GETCOMMENT Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.7 GETCONTENTBLOB Function
This function returns the contents of the resource as a BLOB
.
Syntax
DBMS_XDBRESOURCE.GETCONTENTBLOB ( res IN XDBResource, csid OUT PLS_INTEGER) RETURN BLOB;
Parameters
Table 192-8 GETCONTENTBLOB Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
Character set ID of the |
192.3.8 GETCONTENTCLOB Function
This function returns the contents of the resource as a CLOB
.
Syntax
DBMS_XDBRESOURCE.GETCONTENTCLOB ( res IN XDBResource) RETURN CLOB;
Parameters
Table 192-9 GETCONTENTCLOB Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.9 GETCONTENTREF Function
This function returns the contents of the resource as an XMLTypeRef
.
Syntax
DBMS_XDBRESOURCE.GETCONTENTREF ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-10 GETCONTENTREF Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.10 GETCONTENTTYPE Function
Given an XDBResource, this function returns its content-type.
Syntax
DBMS_XDBRESOURCE.GETCONTENTTYPE ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-11 GETCONTENTTYPE Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.11 GETCONTENTXML Function
This function returns the contents of the resource as an XMLTypeRef
.
Syntax
DBMS_XDBRESOURCE.GETCONTENTXML ( res IN XDBResource) RETURN XMLType;
Parameters
Table 192-12 GETCONTENTXML Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.12 GETCONTENTVARCHAR2 Function
This function returns the contents of the resource as a string.
Syntax
DBMS_XDBRESOURCE.GETCONTENTVARCHAR2 ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-13 GETCONTENTVARCHAR2 Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.13 GETCREATIONDATE Function
Given an XDBResource, this function returns its creation date.
Syntax
DBMS_XDBRESOURCE.GETCREATIONDATE ( res IN XDBResource) RETURN TIMESTAMP;
Parameters
Table 192-14 GETCREATIONDATE Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.14 GETCREATOR Function
Given an XDBResource, this function returns its creator.
Syntax
DBMS_XDBRESOURCE.GETCREATOR ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-15 GETCREATOR Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.15 GETCUSTOMMETADATA Function
This function returns the requested custom metadata given the xpath and namespace to the metadata.
Syntax
DBMS_XDBRESOURCE.GETCUSTOMMETADATA ( res IN XDBResource, xpath IN VARCHAR2, namespace IN VARCHAR2) RETURN XMLType;
Parameters
Table 192-16 GETCUSTOMMETADATA Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
XPath for custom metadata |
|
Namespace |
Usage Notes
The first component of the XPath expression must be "Resource".
192.3.16 GETDISPLAYNAME Function
Given an XDBResource, this function returns its display name.
Syntax
DBMS_XDBRESOURCE.GETDISPLAYNAME ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-17 GETDISPLAYNAME Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.17 GETLANGUAGE Function
Given an XDBResource, this function returns its language.
Syntax
DBMS_XDBRESOURCE.GETLANGUAGE ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-18 GETLANGUAGE Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.18 GETLASTMODIFIER Function
Given an XDBResource, this function returns its last modifier.
Syntax
DBMS_XDBRESOURCE.GETLASTMODIFIER ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-19 GETLASTMODIFIER Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.19 GETMODIFICATIONDATE Function
Given an XDBResource, this function returns its modification date.
Syntax
DBMS_XDBRESOURCE.GETMODIFICATIONDATE ( res IN XDBResource) RETURN TIMESTAMP;
Parameters
Table 192-20 GETMODIFICATIONDATE Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.20 GETOWNER Function
Given an XDBResource, this function returns its owner.
Syntax
DBMS_XDBRESOURCE.GETOWNER ( res IN XDBResource) RETURN VARCHAR2;
Parameters
Table 192-21 GETOWNER Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.21 GETREFCOUNT Function
Given an XDBResource, this function returns its reference count.
Syntax
DBMS_XDBRESOURCE.GETREFCOUNT ( res IN XDBResource) RETURN PLS_INTEGER;
Parameters
Table 192-22 GETREFCOUNT Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.22 GETVERSIONID Function
Given an XDBResource, this function returns its version ID.
Syntax
DBMS_XDBRESOURCE.GETVERSIONID ( res IN XDBResource) RETURN PLS_INTEGER;
Parameters
Table 192-23 GETVERSIONID Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.23 HASACLCHANGED Function
This function returns TRUE
if the ACL of the given resource has changed, FALSE
otherwise.
Syntax
DBMS_XDBRESOURCE.HASACLCHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-24 HASACLCHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.24 HASAUTHORCHANGED Function
This function returns TRUE
if the author of the given resource has changed, FALSE
otherwise.
Syntax
DBMS_XDBRESOURCE.HASAUTHORCHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-25 HASAUTHORCHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.25 HASCHANGED Function
Given an XPath, this function determines whether the element or attribute represented by the XPath has changed.
Syntax
DBMS_XDBRESOURCE.HASCHANGED ( res IN XDBResource, xpath IN VARCHAR2, namespace IN VARCHAR2) RETURN BOOLEAN;
Parameters
Table 192-26 HASCHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
XPath to check |
|
Namespace to use |
192.3.26 HASCHARACTERSETCHANGED Function
This function returns TRUE
if the character set of the given resource has changed, FALSE
otherwise.
Syntax
DBMS_XDBRESOURCE.HASCHARACTERSETCHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-27 HASCHARACTERSETCHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.27 HASCOMMENTCHANGED Function
This function returns TRUE
if the comment of the given resource has changed, FALSE
otherwise.
Syntax
DBMS_XDBRESOURCE.HASCOMMENTCHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-28 HASCOMMENTCHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.28 HASCONTENTCHANGED Function
This function returns TRUE
if the contents of the given resource has changed, FALSE
otherwise.
Syntax
DBMS_XDBRESOURCE.HASCONTENTCHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-29 HASCONTENTCHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.29 HASCONTENTTYPECHANGED Function
This function returns TRUE
if the content-type of the given resource has changed, FALSE
otherwise
Syntax
DBMS_XDBRESOURCE.HASCONTENTTYPECHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-30 HASCONTENTTYPECHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.30 HASCREATIONDATECHANGED Function
This function returns TRUE
if the creation date of the given resource has changed, FALSE
otherwise
Syntax
DBMS_XDBRESOURCE.HASCREATIONDATECHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-31 HASCREATIONDATECHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.31 HASCREATORCHANGED Function
This function returns TRUE
if the creator of the given resource has changed, FALSE
otherwise
Syntax
DBMS_XDBRESOURCE.HASCREATORCHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-32 HASCREATORCHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.32 HASCUSTOMMETADATACHANGED Function
This function checks whether the custom-metadata for a given resource has changed.
Syntax
DBMS_XDBRESOURCE.HASCUSTOMMETADATACHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-33 HASCUSTOMMETADATACHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.33 HASDISPLAYNAMECHANGED Function
This function returns TRUE
if the display name of the given resource has changed, FALSE
otherwise.
Syntax
DBMS_XDBRESOURCE.HASDISPLAYNAMECHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-34 HASDISPLAYNAMECHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.34 HASLANGUAGECHANGED Function
This function returns TRUE
if the language of the given resource has changed, FALSE
otherwise.
Syntax
DBMS_XDBRESOURCE.HASLANGUAGECHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-35 HASLANGUAGECHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.35 HASLASTMODIFIERCHANGED Function
This function returns TRUE
if the last modifier of the given resource has changed, FALSE
otherwise
Syntax
DBMS_XDBRESOURCE.HASLASTMODIFIERCHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-36 HASLASTMODIFIERCHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.36 HASMODIFICATIONDATECHANGED Function
This function returns TRUE
if the modification date of the given resource has changed, FALSE
otherwise
Syntax
DBMS_XDBRESOURCE.HASMODIFICATIONDATECHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-37 HASMODIFICATIONDATECHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.37 HASOWNERCHANGED Function
This function returns TRUE
if the owner of the given resource has changed, FALSE
otherwise.
Syntax
DBMS_XDBRESOURCE.HASOWNERCHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-38 HASOWNERCHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.38 HASREFCOUNTCHANGED Function
This function returns TRUE
if the reference count of the given resource has changed, FALSE
otherwise.
Syntax
DBMS_XDBRESOURCE.HASREFCOUNTCHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-39 HASREFCOUNTCHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.39 HASVERSIONIDCHANGED Function
This function returns TRUE
if the version ID of the given resource has changed, FALSE
otherwise.
Syntax
DBMS_XDBRESOURCE.HASVERSIONIDCHANGED ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-40 HASVERSIONIDCHANGED Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.40 ISFOLDER Function
This function returns TRUE
if the given resource is a folder, FALSE
otherwise.
Syntax
DBMS_XDBRESOURCE.ISFOLDER ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-41 ISFOLDER Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.41 ISNULL Function
This function returns TRUE
if input resource is NULL
.
Syntax
DBMS_XDBRESOURCE.ISNULL ( res IN XDBResource) RETURN BOOLEAN;
Parameters
Table 192-42 ISNULL Function Parameters
Parameter | Description |
---|---|
|
Input resource |
192.3.42 MAKEDOCUMENT Function
This function converts the XDBResource to a DOMDocument which can be operated on using the XMLDOM interface.
See Also:
The DBMS_XMLDOM package
Syntax
DBMS_XDBRESOURCE.MAKEDOCUMENT ( res IN XDBResource) RETURN DBMS_XMLDOM.DOMDocument;
Parameters
Table 192-43 MAKEDOCUMENT Function Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.43 SAVE Procedure
This procedures updates the resource with any modifications.
Syntax
DBMS_XDBRESOURCE.SAVE ( res IN XDBResource);
Parameters
Table 192-44 SAVE Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource |
192.3.44 SETACL Procedure
This procedure sets the ACL of the given XDBResource to the path specified.
Syntax
DBMS_XDBRESOURCE.SETACL ( res IN OUT XDBResource, ACLPath IN VARCHAR2);
Parameters
Table 192-45 SETACL Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
Absolute path of the new ACL |
192.3.45 SETAUTHOR Procedure
This procedure sets the author of the given XDBResource to the specified string.
Syntax
DBMS_XDBRESOURCE.SETAUTHOR ( res IN OUT XDBResource, author IN VARCHAR2);
Parameters
Table 192-46 SETAUTHOR Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
Author |
192.3.46 SETCHARACTERSET Procedure
This procedure sets the character set of the given XDBResource to a specified character set.
Syntax
DBMS_XDBRESOURCE.SETCHARACTERSET ( res IN OUT XDBResource, charSet IN VARCHAR2);
Parameters
Table 192-47 SETCHARACTERSET Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
New character set |
192.3.47 SETCOMMENT Procedure
This procedure sets a comment associated with the given XDBResource.
Syntax
DBMS_XDBRESOURCE.SETCOMMENT ( res IN OUT XDBResource, comment IN VARCHAR2);
Parameters
Table 192-48 SETCOMMENT Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
New comment |
192.3.48 SETCONTENT Procedures
This procedure replaces the contents of the given resource with the given datatype.
Syntax
DBMS_XDBRESOURCE.SETCONTENT ( res IN OUT XDBResource, data IN BFILE, csid IN NUMBER); DBMS_XDBRESOURCE.SETCONTENT ( res IN OUT XDBResource, data IN BLOB, csid IN PLS_INTEGER); DBMS_XDBRESOURCE.SETCONTENT ( res IN OUT XDBResource, data IN CLOB); DBMS_XDBRESOURCE.SETCONTENT ( res IN OUT XDBResource, data IN REF SYS.XMLType, sticky IN BOOLEAN := TRUE); DBMS_XDBRESOURCE.SETCONTENT ( res IN OUT XDBResource, data IN VARCHAR2); DBMS_XDBRESOURCE.SETCONTENT ( res IN OUT XDBResource, data IN SYS.XMLType);
Parameters
Table 192-49 SETCONTENT Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
Data input as |
|
Character set ID of the |
|
If |
192.3.49 SETCONTENTTYPE Procedure
This procedure sets the content-type of the given XDBResource.
Syntax
DBMS_XDBRESOURCE.SETCONTENTTYPE ( res IN OUT XDBResource, conttype IN VARCHAR2);
Parameters
Table 192-50 SETCONTENTTYPE Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
New content-type |
192.3.50 SETCUSTOMMETADATA Procedure
This procedure sets the custom metadata specified by the xpath and namespace to new data.
Syntax
DBMS_XDBRESOURCE.SETCUSTOMMETADATA ( res IN OUT XDBResource, xpath IN VARCHAR2, namespace IN VARCHAR2, newMetadata IN XMLType);
Parameters
Table 192-51 SETCUSTOMMETADATA Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
XPath to change |
|
Namespace to use |
|
New data that should replace the metadata at the given XPath |
Usage Notes
The first component of the XPath expression must be "Resource".
192.3.51 SETDISPLAYNAME Procedure
This procedure sets the display name of the given XDBResource.
Syntax
DBMS_XDBRESOURCE.SETDISPLAYNAME ( res IN OUT XDBResource, name IN VARCHAR2);
Parameters
Table 192-52 SETDISPLAYNAME Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
New display name |
192.3.52 SETLANGUAGE Procedure
This procedure sets the language of the given XDBResource
.
Syntax
DBMS_XDBRESOURCE.SETLANGUAGE ( res IN OUT XDBResource, ACLPath IN VARCHAR2);
Parameters
Table 192-53 SETLANGUAGE Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
New path |
192.3.53 SETOWNER Procedure
This procedure sets the owner of the given XDBResource.
Syntax
DBMS_XDBRESOURCE.SETOWNER ( res IN OUT XDBResource, owner IN VARCHAR2);
Parameters
Table 192-54 SETOWNER Procedure Parameters
Parameter | Description |
---|---|
|
XDBResource |
|
New owner |
Usage Notes
The user must have the XDBADMIN
privilege to call this subprogram.