Oracle XML DB Resource View API

Description of Oracle XML DB Resource View package

The resource view and path view both provide a mechanism for SQL access for data that is stored in the Oracle XML DB repository. Data which is stored in the Oracle XML DB repository ia protocols like FTP, WebDAV or programming API such as JNDI can be accessed in SQL through these views and vice versa. Resource view and path view together (along with some PL/SQL packages) provide all the query and DML functionality that is available through the programming API. The PATH VIEW has one row for each unique path in the repository, whereas the resource view has one row for each resource in the repository.

Returns the folder depth of the resource under the specified starting path.

UNDER_PATH

Description

The UNDER_PATH operator uses the Oracle XML DB hierarchical index to return the paths under a particular path. The hierarchical index is designed to speed access walking down a path name (the normal usage). If the other parts of the query predicate are very selective, however, a functional implementation of UNDER_PATH may be chosen that will walk back up the repository. This can be more efficient, since a much smaller number of links may need to be traversed. The options are described in the following table.

Syntax

Description

INTEGER UNDER_PATH( resource_column,

pathname);

Determines if a resource is under a specified path.

INTEGER UNDER_PATH( resource_column,

depth,

pathname);

Determines if a resource is under a specified path, with a depth argument to restrict the number of levels to search.

INTEGER UNDER_PATH( resource_column,

pathname,

correlation)

Determines if a resource is under a specified path, with a correlation argument for ancillary operators.

INTEGER UNDER_PATH( resource_column,

depth,

pathname,

correlation)

Determines if a resource is under a specified path with a depth argument to restrict the number of levels to search, and with a correlation argument for ancillary operators.

Note that only one of the accessible paths to the resource needs to be under the path argument for a resource to be returned.

Parameter

Description

resource_column

The column name or column alias of the 'resource' column in the path_view or resource_view.

pathname

The path name to resolve.

depth

The maximum depth to search; a depth of less than 0 is treated as 0.

correlation

An integer that can be used to correlate the UNDER_PATH operator (a primary operator) with ancillary operators (PATH & DEPTH).

PATH

Description

An ancillary operator that returns the relative path name of the resource under the specified pathname argument. Note that the path column in the resource view always contains the absolute path of the resource.

Syntax

PATH VARCHAR2 PATH( correlation);

Parameter

Description

correlation

An integer that can be used to correlate the UNDER_PATH operator (a primary operator) with ancillary operators (PATH & DEPTH).

DEPTH

Description

An ancillary operator that returns the folder depth of the resource under the specified starting path.

Syntax

DEPTH INTEGER DEPTH( correlation);

Parameter

Description

correlation

An integer that can be used to correlate the UNDER_PATH operator (a primary operator) with ancillary operators (PATH & DEPTH).