René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

dbms_xmlschema

Procedures/Functions

compileschema

procedure compileschema (
 schemaurl                          in                 varchar2        
);

converttodate

function converttodate returns date (
 strval                             in                 varchar2        ,
 xmltypename                        in                 varchar2        
);

converttots

function converttots returns timestamp (
 strval                             in                 varchar2        ,
 xmltypename                        in                 varchar2        
);

converttotswithtz

function converttotswithtz returns timestamp with time zone (
 strval                             in                 varchar2        ,
 xmltypename                        in                 varchar2        
);

copyevolve

procedure copyevolve (
 schemaurls                         in        xdb$string_list_t        ,
 newschemas                         in          xmlsequencetype        ,
 transforms                         in          xmlsequencetype default,
 preserveolddocs                    in                  boolean default,
 maptabname                         in                 varchar2 default,
 generatetables                     in                  boolean default,
 force                              in                  boolean default,
 schemaowners                       in        xdb$string_list_t default
);

deleteschema

procedure deleteschema (
 schemaurl                          in                 varchar2        ,
 delete_option                      in           binary_integer default
);
dbms_xmlschema.deleteSchema('schema_url');

dbms_xmlschema.deleteSchema('schema_url', dbms_xmlschema.delete_restrict);
dbms_xmlschema.deleteSchema('schema_url', dbms_xmlschema.delete_invalidate);
dbms_xmlschema.deleteSchema('schema_url', dbms_xmlschema.delete_cascade);
dbms_xmlschema.deleteSchema('schema_url', dbms_xmlschema.delete_cascade_force);
Used to delete a schema previously registered with registerSchema.

generatebean

procedure generatebean (
 schemaurl                          in                 varchar2        
);

generateschema

function generateschema returns xmltype (
 schemaname                         in                 varchar2        ,
 typename                           in                 varchar2        ,
 elementname                        in                 varchar2 default,
 recurse                            in                  boolean default,
 annotate                           in                  boolean default,
 embedcoll                          in                  boolean default
);

generateschemas

function generateschemas returns xmlsequencetype (
 schemaname                         in                 varchar2        ,
 typename                           in                 varchar2        ,
 elementname                        in                 varchar2 default,
 schemaurl                          in                 varchar2 default,
 annotate                           in                  boolean default,
 embedcoll                          in                  boolean default
);

registerschema

procedure registerschema (
 schemaurl                          in                 varchar2        ,
 schemadoc                          in                 varchar2        ,
 local                              in                  boolean default,
 gentypes                           in                  boolean default,
 genbean                            in                  boolean default,
 gentables                          in                  boolean default,
 force                              in                  boolean default,
 owner                              in                 varchar2 default
);
procedure registerschema (
 schemaurl                          in                 varchar2        ,
 schemadoc                          in                     clob        ,
 local                              in                  boolean default,
 gentypes                           in                  boolean default,
 genbean                            in                  boolean default,
 gentables                          in                  boolean default,
 force                              in                  boolean default,
 owner                              in                 varchar2 default
);
procedure registerschema (
 schemaurl                          in                 varchar2        ,
 schemadoc                          in                     blob        ,
 local                              in                  boolean default,
 gentypes                           in                  boolean default,
 genbean                            in                  boolean default,
 gentables                          in                  boolean default,
 force                              in                  boolean default,
 owner                              in                 varchar2 default
);
procedure registerschema (
 schemaurl                          in                 varchar2        ,
 schemadoc                          in                     blob        ,
 local                              in                  boolean default,
 gentypes                           in                  boolean default,
 genbean                            in                  boolean default,
 gentables                          in                  boolean default,
 force                              in                  boolean default,
 owner                              in                 varchar2 default,
 csid                               in                   number        
);
procedure registerschema (
 schemaurl                          in                 varchar2        ,
 schemadoc                        file                   binary     lob,
 local                              in                  boolean default,
 gentypes                           in                  boolean default,
 genbean                            in                  boolean default,
 gentables                          in                  boolean default,
 force                              in                  boolean default,
 owner                              in                 varchar2 default
);
procedure registerschema (
 schemaurl                          in                 varchar2        ,
 schemadoc                        file                   binary     lob,
 local                              in                  boolean default,
 gentypes                           in                  boolean default,
 genbean                            in                  boolean default,
 gentables                          in                  boolean default,
 force                              in                  boolean default,
 owner                              in                 varchar2 default,
 csid                               in                   number        
);
procedure registerschema (
 schemaurl                          in                 varchar2        ,
 schemadoc                          in                  xmltype        ,
 local                              in                  boolean default,
 gentypes                           in                  boolean default,
 genbean                            in                  boolean default,
 gentables                          in                  boolean default,
 force                              in                  boolean default,
 owner                              in                 varchar2 default
);
procedure registerschema (
 schemaurl                          in                 varchar2        ,
 schemadoc                          in                  uritype        ,
 local                              in                  boolean default,
 gentypes                           in                  boolean default,
 genbean                            in                  boolean default,
 gentables                          in                  boolean default,
 force                              in                  boolean default,
 owner                              in                 varchar2 default
);
RegisterSchema does four things:
  • Parses and validates an XML schema
  • Creates entries in the Oracle data dictionary that describe this schema
  • Creates object definitions (for complex types
  • Creates an XMLType table for each global element defined in the XML Schema.
In order to monitor the creation of object types and tables, use the diagnostic event 31098.
A Schema can be registered locally or globally.
If either of gentables or gentypes is set to true, one might want to annotate the schema.
After a schema has been registered, an XMLType instance can be validated using the following four validation methods: schemaValidate, isSchemaValid, isSchemaValidated and setSchemaValidated.
Registered schemas can be viewed through dba_xml_schemas.

gentables

registeruri

procedure registeruri (
 schemaurl                          in                 varchar2        ,
 schemadocuri                       in                 varchar2        ,
 local                              in                  boolean default,
 gentypes                           in                  boolean default,
 genbean                            in                  boolean default,
 gentables                          in                  boolean default,
 force                              in                  boolean default,
 owner                              in                 varchar2 default
);