PL/SQL Packages and Types Reference 10g Release 1 (10.1) Part Number B10802-01 |
|
|
View PDF |
DBMS_XMLSCHEMA
package provides procedures to register and delete XML schemas. It is created by script dbmsxsch.sql
during Oracle database installation.
This chapter contains the following topics:
Constant | Description |
---|---|
DELETE_RESTRICT |
CONSTANT NUMBER := 1; |
DELETE_INVALIDATE |
CONSTANT NUMBER := 2; |
DELETE_CASCADE |
CONSTANT NUMBER := 3; |
DELETE_CASCADE_FORCE |
CONSTANT NUMBER := 4; |
This procedure can be used to re-compile an already registered XML schema. This is useful for bringing a schema in an invalid state to a valid state. Can result in a ORA-31001
exception: invalid resource handle or path name.
PROCEDURE compileSchema( SCHEMAURL IN VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
SCHEMAURL |
(IN) |
URL identifying the schema. |
Evolves registered schemas so that existing XML instances remain valid. You should back up all schemas and documents prior to invocation because COPYEVOLVE deletes all conforming documents prior to implementing the schema evolution.
This procedure is accomplished in according to the following basic scenario (alternative actions are controlled by the procedure's parameters):
XMLType
tables to temporary table storageXMLType
tablesSee Also:
|
PROCEDURE copyEvolve( schemaURLs IN XDB$STRUBG_LIST_T, newSchemas IN XMLSequenceType, transforms IN XMLSequenceType:=NULL, preserveOldDocs IN BOOLEAN:=FALSE, mapTableName IN VARCHAR2:=NULL, generateTables IN BOOLEAN:=TRUE, force IN bOOLEAN:=FALSE, schemaOwners IN XDB$STRING_LIST_T:=NULL);
Deletes the XML Schema specified by the URL. Can result in a ORA-31001
exception: invalid resource handle or path name.
PROCEDURE deleteSchema( SCHEMAURL IN VARCHAR2, delete_option IN pls_integer := DELETE_RESTRICT);
This procedure can be used to generate the Java bean code corresponding to a registered XML schema. Note that there is also an option to generate the beans as part of the registration procedure itself. Can result in a ORA-31001
exception: invalid resource handle or path name.
PROCEDURE generateBean( SCHEMAURL IN VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
SCHEMAURL |
(IN) |
Name identifying a registered XML schema. |
These functions generate XML schema(s) from an Oracle type name. Inlines all in one schema (XMLType
). Can result in a ORA-31001
exception: invalid resource handle or path name.
function generateSchema( schemaName IN VARCHAR2, typeName IN VARCHAR2, elementName IN VARCHAR2 := NULL, recurse IN BOOLEAN := TRUE, annotate IN BOOLEAN := TRUE, embedColl IN BOOLEAN := TRUE ) return sys.XMLType;
These functions generate XML schema(s) from an Oracle type name. Returns a collection of XMLType
s, one XML Schema document for each database schema. Can result in a ORA-31001
exception: invalid resource handle or path name.
function generateSchema( schemaName IN VARCHAR2, typeName IN VARCHAR2, elementName IN VARCHAR2 := NULL, SCHEMAURL IN VARCHAR2 := NULL, annotate IN BOOLEAN := TRUE, embedColl IN BOOLEAN := TRUE ) return sys.XMLType;
Registers the specified schema for use by the database.
Registers an XML Schema specified by a URI name.
PROCEDURE registerURI( SCHEMAURL IN varchar2, schemaDocURI IN varchar2, local IN BOOLEAN := TRUE, genTypes IN BOOLEAN := TRUE, genbean IN BOOLEAN := FALSE, genTables IN BOOLEAN := TRUE, force IN BOOLEAN := FALSE, owner IN VARCHAR2 := null);
Parameter | IN / OUT | Description |
---|---|---|
SCHEMAURL |
(IN) |
Uniquely identifies the schema document. Can be used inside |
schemaDocURI |
(IN) |
Pathname (URI) corresponding to the physical location of the schema document. The URI path could be based on HTTP, FTP, DB or Oracle XML DB protocols. This function constructs a |
local |
(IN) |
Is this a local or global schema? By default, all schemas are registered as local schemas, under |
genTypes |
(IN) |
Should the compiler generate object types? By default, |
genbean |
(IN) |
Should the compiler generate Java beans? By default, |
genTables |
(IN) |
Should the compiler generate default tables? |
force |
(IN) |
|
owner |
(IN) |
This parameter specifies the name of the database user owning the XML schema object. By default, the user registering the schema owns the XML schema object. This parameter can be used to register a XML schema to be owned by a different database user. |
Lists all schemas (local and global) belonging to the current user.
Column | Datatype | Description |
---|---|---|
SCHEMA_URL |
VARCHAR2 |
URL of XML schema |
LOCAL |
VARCHAR2 |
Local schema (YES/NO) |
SCHEMA |
XMLTYPE |
XML Schema document |
Lists all local schemas belonging to the current user and all global schemas.
Column | Datatype | Description |
---|---|---|
OWNER |
VARCHAR2 |
Database user owning XML schema |
SCHEMA_URL |
VARCHAR2 |
URL of XML schema |
LOCAL |
VARCHAR2 |
Local schema (YES/NO) |
SCHEMA |
XMLTYPE |
XML Schema document |
Lists all registered local and global schemas in the system.
Column | Datatype | Description |
---|---|---|
OWNER |
VARCHAR2 |
Database user owning XML schema |
SCHEMA_URL |
VARCHAR2 |
URL of XML schema |
LOCAL |
VARCHAR2 |
Local schema (YES/NO) |
SCHEMA |
XMLTYPE |
XML Schema document |
Lists all XMLType tables in the system.
Lists all local XMLType
tables belonging to the current user.
Lists all local XMLType
tables belonging to the current user and all global tables visible to the current user.
Lists all XMLType
columns in the system.
Lists all XMLType
columns in tables belonging to the current user.
Lists all XMLType
columns in tables belonging to the current user and all global tables visible to the current user.
Lists all XMLType
views in the system.
Column | Datatype | Description |
---|---|---|
OWNER |
VARCHAR2 |
Database user owning view |
VIEW_NAME |
VARCHAR2 |
Name of |
XMLSCHEMA |
VARCHAR2 |
XML Schema URL |
ELEMENT_NAME |
VARCHAR2 |
XML Schema element |
Lists all local XMLType
views belonging to the current user.
Column | Datatype | Description |
---|---|---|
VIEW_NAME |
VARCHAR2 |
Name of |
XMLSCHEMA |
VARCHAR2 |
XML Schema URL |
ELEMENT_NAME |
VARCHAR2 |
XML Schema element |
Lists all local XMLType
views belonging to the current user and all global views visible to the current user.
Column | Datatype | Description |
---|---|---|
OWNER |
VARCHAR2 |
Database user owning view |
VIEW_NAME |
VARCHAR2 |
Name of |
XMLSCHEMA |
VARCHAR2 |
XML Schema URL |
ELEMENT_NAME |
VARCHAR2 |
XML Schema element |
Lists all XMLType
columns in the system.
Lists all XMLType
columns in views belonging to the current user.
Column | Datatype | Description |
---|---|---|
VIEW_NAME |
VARCHAR2 |
Name of view. |
COLUMN_NAME |
VARCHAR2 |
Name of |
XMLSCHEMA |
VARCHAR2 |
XML Schema URL. |
ELEMENT_NAME |
VARCHAR2 |
XML Schema element. |
Lists all XMLType
columns in views belonging to the current user and all global views visible to the current user.