| PL/SQL Packages and Types Reference 10g Release 1 (10.1) Part Number B10802-01 |
|
|
View PDF |
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:
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;
| 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);
| 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;
| Parameter | Description |
|---|---|
|
|
The resource id. |
This function obtains contents as a CLOB.
DBMS_XDB_VERSION.GETCONTENTSCLOBYRESID( resid DBMS_XDB.resid_type) RETURN CLOB;
| Parameter | Description |
|---|---|
|
|
The resource id. |
This function obtains contents as an XMLType.
DBMS_XDB_VERSION.GETCONTENTSXMLBYRESID( resid DBMS_XDB.resid_type) RETURN XMLType;
| Parameter | Description |
|---|---|
|
|
The resource id. |
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;
| 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;
| Parameter | Description |
|---|---|
|
|
The resource id. |
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;
| Parameter | Description |
|---|---|
|
|
The resource id. |
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;
| 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;
| Parameter | Description |
|---|---|
|
|
The resource id. |
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;
| 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 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;
| Parameter | Description |
|---|---|
|
|
The path name of the checked-out resource. |
This is not an auto-commit SQL operation. UNCHECKOUT Function doesn't have to take the same path name that was passed to CHECKOUT Procedure 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.