Oracle XML DB versioning APIs are found in the DBMS_XBD_VERSION
package. Functions and procedures of DBMS_XDB_VERSION
help to create a VCR and manage the versions in the version history.
This chapter contains the following topic:
Table 122-1 DBMS_XDB_VERSION Package Subprograms
Method | Description |
---|---|
Checks in a checked-out VCR and returns the resource id of the newly-created version |
|
Checks out a VCR before updating or deleting it |
|
Obtain contents as a |
|
Obtain contents as a |
|
Obtain contents as an |
|
Retrieves the list of predecessors by path name |
|
Retrieves the list of predecessors by resource id |
|
Obtains the resource as an |
|
Retrieves the list of successors by path name |
|
Retrieves the list of successors by resource id |
|
Turns a regular resource whose path name is given into a version-controlled resource |
|
Checks in a checked-out resource, returns the resource id of the version before the resource is checked out |
This function checks in a checked-out VCR and returns the resource id of the newly-created version.
DBMS_XDB_VERSION.CHECKIN( pathname VARCHAR2) RETURN DBMS_XDB.resid_type;
Table 122-2 CHECKIN Function Parameters
Parameter | Description |
---|---|
|
The path name of the checked-out resource. |
This is not an auto-commit SQL operation. CHECKIN Function doesn't have to take the same path name that was passed to CHECKOUT Procedure operation. However, the CHECKIN Function path name and the CHECKOUT Procedure path name must be of the same resource for the operations to function correctly. If the resource has been renamed, the new name must be used to CHECKIN Function because the old name is either invalid or is currently bound with a different resource. Exception is raised if the path name does not exist. If the path name has been changed, the new path name must be used to CHECKIN Function the resource.
This procedure checks out a VCR before updating or deleting it.
DBMS_XDB_VERSION.Checkout( pathname VARCHAR2);
Table 122-3 CHECKOUT Procedure Parameters
Parameter | Description |
---|---|
|
The path name of the VCR to be checked out. |
This is not an auto-commit SQL operation. Two users of the same workspace cannot CHECKOUT Procedure the same VCR at the same time. If this happens, one user must rollback. As a result, it is good practice to commit the CHECKOUT Procedure operation before updating a resource and avoid loss of the update if the transaction is rolled back. An exception is raised if the given resource is not a VCR, if the VCR is already checked out, if the resource doesn't exist.
This function obtain contents as a BLOB
.
DBMS_XDB_VERSION.GETCONTENTSBLOBYRESID( resid DBMS_XDB.resid_type) RETURN BLOB;
This function obtains contents as a CLOB
.
DBMS_XDB_VERSION.GETCONTENTSCLOBYRESID( resid DBMS_XDB.resid_type) RETURN CLOB;
This function obtains contents as an XMLType
.
DBMS_XDB_VERSION.GETCONTENTSXMLBYRESID( resid DBMS_XDB.resid_type) RETURN XMLType;
If the contents are not valid XML, returns NULL
.
This function retrieves the list of predecessors by the path name.
DBMS_XDB_VERSION.GETPREDECESSORS( pathname VARCHAR2) RETURN resid_list_type;
Table 122-7 GETPREDECESSORS Function Parameters
Parameter | Description |
---|---|
|
The path name of the resource. |
An exception is raised if PATHNAME
is illegal.
This function retrieves the list of predecessors by resource id.
DBMS_XDB_VERSION.GETPREDSBYRESID( resid resid_type) RETURN resid_list_type;
Getting predecessors by RESID
is more efficient than by PATHNAME
.
An exception is raised if the RESID
is illegal.
This function obtains the resource as an XMLType
, given the resource object ID. Because the system will not create a path name for versions, this function is useful for retrieving the resource using its resource id.
DBMS_XDB_VERSION.GETRESOURCEBYRESID( resid resid_type) RETURN XMLType;
Given a version resource or a VCR, this function retrieves the list of the successors of the resource by the path name.
DBMS_XDB_VERSION.GETSUCCESSORS( pathname VARCHAR2) RETURN resid_list_type;
Table 122-10 GETSUCCESSORS Function Parameters
Parameter | Description |
---|---|
|
The path name of the resource. |
Getting successors by RESID
is more efficient than by PATHNAME
.
An exception is raised if the PATHNAME
is illegal.
This function retrieves the list of the successors of the resource by resource id using version resource or VCR.
DBMS_XDB_VERSION.GETSUCCSBYRESID( resid resid_type) RETURN resid_list_type;
Getting successors by RESID
is more efficient than by PATHNAME
.
An exception is raised if the PATHNAME
is illegal.
This function turns a regular resource whose path name is given into a version-controlled resource. This new resource is then put under version control. All other path names continue to refer to the original resource.
DBMS_XDB_VERSION.MAKEVERSIONED( pathname VARCHAR2) RETURN DBMS_XDB.resid_type;
Table 122-12 MAKEVERSIONED Function Parameters
Parameter | Description |
---|---|
|
The path name of the resource to be put under version control. |
This function returns the resource ID of the first version, or root, of the VCR.
If two or more path names are bound with the same resource, a copy of the resource will be created, and the given path name will be bound with the newly-created copy.
This is not an auto-commit SQL operation. An exception is raised if the resource doesn't exist.
This call is legal for VCR, and neither exception nor warning is raised.
This call is illegal for folder, version history, version resource, and ACL.
No support for Schema-based resources is provided.
This function checks-in a checked-out resource and returns the resource id of the version before the resource is checked out.
DBMS_XDB_VERSION.UNCHECKOUT( pathname VARCHAR2) RETURN DBMS_XDB.resid_type;
Table 122-13 UNCHECKOUT Function Parameters
Parameter | Description |
---|---|
|
The path name of the checked-out resource. |
This is not an auto-commit SQL operation. UNCHECKOUT FunctionCHECKOUT Procedure doesn't have to take the same path name that was passed to operation. However, the UNCHECKOUT Function path name and the CHECKOUT Procedure path name must be of the same resource for the operations to function correctly. If the resource has been renamed, the new name must be used to UNCHECKOUT Function, because the old name is either invalid or is currently bound with a different resource. If the path name has been changed, the new path name must be used to UNCHECKOUT Function the resource.
An exception is raised if the path name doesn't exist.