Summary of DBMS_METADATA Procedures

This section provides brief descriptions of the procedures provided by the DBMS_METADATA API. For detailed descriptions of these procedures, see Oracle Database PL/SQL Packages and Types Reference.

Table 21-1 provides a brief description of the procedures provided by the DBMS_METADATA programmatic interface for retrieving multiple objects.


Table 21-1 DBMS_METADATA Procedures Used for Retrieving Multiple Objects

PL/SQL Procedure Name Description
DBMS_METADATA.OPEN()

Specifies the type of object to be retrieved, the version of its metadata, and the object model.

DBMS_METADATA.SET_FILTER()

Specifies restrictions on the objects to be retrieved, for example, the object name or schema.

DBMS_METADATA.SET_COUNT()

Specifies the maximum number of objects to be retrieved in a single FETCH_xxx call.

DBMS_METADATA.GET_QUERY()

Returns the text of the queries that are used by FETCH_xxx. You can use this as a debugging aid.

DBMS_METADATA.SET_PARSE_ITEM()

Enables output parsing by specifying an object attribute to be parsed and returned.

DBMS_METADATA.ADD_TRANSFORM()

Specifies a transform that FETCH_xxx applies to the XML representation of the retrieved objects.

DBMS_METADATA.SET_TRANSFORM_PARAM()

Specifies parameters to the XSLT stylesheet identified by transform_handle.

DBMS_METADATA.SET_REMAP_PARAM()

Specifies parameters to the XSLT stylesheet identified by transform_handle.

DBMS_METADATA.FETCH_xxx()

Returns metadata for objects meeting the criteria established by OPEN, SET_FILTER, SET_COUNT, ADD_TRANSFORM, and so on.

DBMS_METADATA.CLOSE()

Invalidates the handle returned by OPEN and cleans up the associated state.


Table 21-2 lists the procedures provided by the DBMS_METADATA browsing interface and provides a brief description of each one. These functions return metadata for one or more dependent or granted objects. These procedures do not support heterogeneous object types.


Table 21-2 DBMS_METADATA Procedures Used for the Browsing Interface

PL/SQL Procedure Name Description
DBMS_METADATA.GET_xxx()

Provides a way to return metadata for a single object. Each GET_xxx call consists of an OPEN procedure, one or two SET_FILTER calls, optionally an ADD_TRANSFORM procedure, a FETCH_xxx call, and a CLOSE procedure.

The object_type parameter has the same semantics as in the OPEN procedure. schema and name are used for filtering.

If a transform is specified, then session-level transform flags are inherited.

DBMS_METADATA.GET_DEPENDENT_xxx()

Returns the metadata for one or more dependent objects, specified as XML or DDL.

DBMS_METADATA.GET_GRANTED_xxx()

Returns the metadata for one or more granted objects, specified as XML or DDL.


Table 21-3 provides a brief description of the DBMS_METADATA procedures and functions used for XML submission.


Table 21-3 DBMS_METADATA Procedures and Functions for Submitting XML Data

PL/SQL Name Description
DBMS_METADATA.OPENW()

Opens a write context.

DBMS_METADATA.ADD_TRANSFORM()

Specifies a transform for the XML documents

DBMS_METADATA.SET_TRANSFORM_PARAM() and 
DBMS_METADATA.SET_REMAP_PARAM()

SET_TRANSFORM_PARAM specifies a parameter to a transform.

SET_REMAP_PARAM specifies a remapping for a transform.

DBMS_METADATA.SET_PARSE_ITEM()

Specifies an object attribute to be parsed.

DBMS_METADATA.CONVERT()

Converts an XML document to DDL.

DBMS_METADATA.PUT()

Submits an XML document to the database.

DBMS_METADATA.CLOSE()

Closes the context opened with OPENW.