views:

67

answers:

2

How do I select an XML schema previously registered with Oracle?

For example, if I've registered a schema like so:

DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://test.com/my-schema.xsd',
    SCHEMADOC => '...the xsd...,
    ...
);

I would like to be able to get that schema back, ideally something in the vain of:

select s.schemadoc
from magic_schema_table s
where s.schemaurl = 'http://test.com/my-schema.xsd'

Does such a mechanism exist?

Thanks in advance, Oracle Gurus!

A: 

You should find your answer there : XML Schema Storage and Query: Basic

Update:

The only other thing that I can see which can help you would be to generate a schema for a given object type. Here is the way to go: Generating XML Schemas with DBMS_XMLSCHEMA.GENERATESCHEMA

dasilvj
This link appears to be about retrieving schema annotations, not the original xsd itself.
+1  A: 

You can use the Datadictionary View ALL_XML_SCHEMAS.

SELECT SCHEMA
FROM   ALL_XML_SCHEMAS
WHERE  SCHEMA_URL = 'http://test.com/my-schema.xsd';
zürigschnäzlets