Using xmlns in schemas that reference Oracle registered schema

I have two schemas: a.xsd and b.xsd. b.xsd uses an xmlns to reference a.xsd. But when I call dbms_xmlschema.registerSchema, the a.xsd schema works ok, but the b.xsd schema fails with the following error:
ERROR at line 1:
ORA-31154: invalid XML document
ORA-19202: Error occurred in XML processing
LSX-00023: unknown namespace URI "http://xmlns/a"
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 26
ORA-06512: at line 2
I've tried with and without an xsi:schemaLocation in b.xsd and both fail with the same error.
Has anyone had any luck using this multiple schema reference functionality? I'm on the latest Oracle 9i (9.2.0.3.0) 64-bit on Solaris 2.8.
Thanks,
-Darren
Here's the output of my sqlplus session:
SQL*Plus: Release 8.1.6.0.0 - Production on Wed May 14 13:43:56 2003
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production
SQL> set long 10000
SQL> SELECT user FROM dual
2 /
USER
XDB
SQL> SELECT getDocument('xsd/a.xsd') FROM dual
2 /
GETDOCUMENT('XSD/A.XSD')
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://xmlns/a" xmlns="http://xmlns/a" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="a">
<xs:simpleType>
<xs:restriction base="xs:string">
     <xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:schema>
GETDOCUMENT('XSD/A.XSD')
SQL> BEGIN
2 dbms_xmlschema.registerSchema(
3      schemaURL => 'http://xmlns/a',
4      schemaDoc => getDocument('xsd/a.xsd'),
5      local => false);
6 END;
7 /
PL/SQL procedure successfully completed.
SQL> COMMIT
2 /
Commit complete.
SQL> SELECT owner, schema_url FROM all_xml_schemas WHERE schema_url = 'http://xmlns/a'
2 /
OWNER
SCHEMA_URL
XDB
http://xmlns/a
SQL> SELECT getDocument('xsd/b.xsd') FROM dual
2 /
GETDOCUMENT('XSD/B.XSD')
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://xmlns/b" xmlns="http://xmlns/b" xmlns:a="http://xmlns/a" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="b">
<xs:complexType>
<xs:sequence>
     <xs:element name="c">
     <xs:simpleType>
     <xs:restriction base="xs:string">
     <xs:maxLength value="200"/>
     </xs:restriction>
     </xs:simpleType>
     </xs:element>
     <xs:element ref="a:a"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
SQL> BEGIN
2 dbms_xmlschema.registerSchema(
3      schemaURL => 'http://xmlns/b',
4      schemaDoc => getDocument('xsd/b.xsd'),
5      local => false);
6 END;
7 /
BEGIN
ERROR at line 1:
ORA-31154: invalid XML document
ORA-19202: Error occurred in XML processing
LSX-00023: unknown namespace URI "http://xmlns/a"
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 26
ORA-06512: at line 2
SQL> SELECT getDocument('xsd/b-with-location.xsd') FROM dual
2 /
GETDOCUMENT('XSD/B-WITH-LOCATION.XSD')
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
     targetNamespace="http://xmlns/b"
     xmlns="http://xmlns/b"
     xmlns:a="http://xmlns/a"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns/a http://xmlns/a">
<xs:element name="b">
<xs:complexType>
<xs:sequence>
     <xs:element name="c">
     <xs:simpleType>
     <xs:restriction base="xs:string">
     <xs:maxLength value="200"/>
     </xs:restriction>
     </xs:simpleType>
     </xs:element>
     <xs:element ref="a:a"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
SQL> BEGIN
2 dbms_xmlschema.registerSchema(
3      schemaURL => 'http://xmlns/b',
4      schemaDoc => getDocument('xsd/b-with-location.xsd'),
5      local => false);
6 END;
7 /
BEGIN
ERROR at line 1:
ORA-31154: invalid XML document
ORA-19202: Error occurred in XML processing
LSX-00023: unknown namespace URI "http://xmlns/a"
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 26
ORA-06512: at line 2
SQL> COMMIT
2 /
Commit complete.
SQL> SELECT owner, schema_url FROM all_xml_schemas
2 WHERE schema_url = 'http://xmlns/a' OR schema_url = 'http://xmlns/b'
3 /
OWNER
SCHEMA_URL
XDB
http://xmlns/a
SQL> QUIT
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production

This is resolved.

Similar Messages

  • Using SQL Server Script to create Oracle DB Schema

    Hi,
    I have a SQL Server script which does a few things such as creating databases (after dropping), creating tables etc. Now I want to replicate the SQL Server databases and their tables etc in an Oracle9i DB. How would a SQL Server script compare to an Oracle script? i.e. what differences are there? and how would I have to alter the script to have it work on Oracle?
    As an example, my SQL Server script would look something like this:
    DROP DATABASE test1;
    DROP DATABASE test2;
    CREATE DATABASE test1;
    CREATE DATABASE test2;
    GO;
    USE test1;
    CREATE TABLE Table1 (
    TableOneID INT IDENTITY PRIMARY KEY NOT NULL,
    Name VARCHAR(255) NOT NULL,
    PRIMARY KEY(TableOneID));
    CREATE TABLE Table2 (
    TableTwoID INT IDENTITY NOT NULL,
    TableOneID INT NOT NULL,
    PRIMARY KEY(TableTwoID, TableOneID),
    FOREIGN KEY(TableOneID) REFERENCES Table1(TableOneID));
    USE test2;
    CREATE TABLE ....
    etc...
    thanks!

    Also I think
    CREATE TABLE table1
    ( tableoneid INT PRIMARY KEY NOT NULL
    , name VARCHAR(255) NOT NULL
    , PRIMARY KEY(tableoneid) );should probably be
    CREATE TABLE table1
    ( tableoneid INT CONSTRAINT table1_pk PRIMARY KEY
    , name VARCHAR(255) NOT NULL );otherwise you specify the primary key twice (and PRIMARY KEY implies NOT NULL so the NOT NULL is redundant).
    Then TABLE2 might need to be something like:
    CREATE TABLE table2
    ( tabletwoid INT NOT NULL
    , tableoneid NOT NULL CONSTRAINT table2_table1_fk REFERENCES table1
    , CONSTRAINT table2_pk PRIMARY KEY(tabletwoid, tableoneid) );although the table-level constraint syntax could be used for the foreign keys if it meant less editing of your scripts. The "CONSTRAINT constraintname" clause of constraints is optional but recommended, as otherwise they will get system-generated names like "SYS_C005157". (Note that if you specify the FK inline as part of the column definition you do not need to include a datatype.)
    If the IDENTITY clause causes a sequential value to be assigned as a default, there is no direct equivalent to that in Oracle. The nearest thing would be a row-level BEFORE INSERT trigger.

  • Oracle Default Schema?

    Hi Folks,
    Can you please help in finding whether the below given schemas belong to default schemas?
    1.Oracle 9i
    Schema: ENTRDBA
    2.Oracle 11GR2
    Schema: BSCHLANDER, PWELLINSKI
    Thanks
    KSG

    KSG wrote:
    Hi Folks,
    Can you please help in finding whether the below given schemas belong to default schemas?
    1.Oracle 9i
    Schema: ENTRDBA
    2.Oracle 11GR2
    Schema: BSCHLANDER, PWELLINSKI
    I think that they are names picked up based on someone's initial and last names and are not the shipped schemas which come with the database.
    Aman....

  • Performance Problem: Synonym in Schema Referencing Synonym in Diff Schema

    Does anyone have any experience using a synonym in one schema that references another synonym in another schema? I found that if I do it this way, the performance drops considerably depending upon the SQL. It runs slow and in some cases I get Oracle errors (i.e. Invalid ROWID). If I change my synonym to reference the actual table in the other schema, it don't get the same degradation in performance.
    I'm curious if anyone has experienced the same problem and what options might be available to improve the situation. I lose the "semantic" layer by doing this - having to always reference the physical table instead of the synonym in the other schema.
    Thanks for any input or comments you might have.
    Sabert

    Only 2 schemas. Schema A has a table T1 with a public synonym S1. I am running sql against Schema B, however I have a private synonym S2 in this schema (B) that references synonym S1 in Schema A. Because I am using a synonym to reference another synonym in another schema I'm having performance issues. I tried a test and changed the S2 synonym in schema B to point to the table T1 instead of S1 in schema A and it performed much better. Just want to understand what I'm seeing here. This example might help:
    Schema A:
    "CREATE SYNONYM S1 FOR T1"
    Schema B (I'm running my sql against this schema, but my synonym points to table in schema A):
    "CREATE SYNONYM S2 FOR A.S1"
    "INSERT INTO XXX SELECT * FROM S2"
    I had performance issues with this synonym to synonym, so I changed it to synonym to table:
    "CREATE SYNONYM S2 FOR A.T1"
    Again, with the change in reference from a synonym to the actual table, things seem to work better. Hope this makes sense.
    Thanks for your help.

  • How can I  refer an xml  Schema that was registred in Oracle xml DB

    How can I refer an xml Schema that was registred in Oracle xml DB, from other xml schema?
    I have the follow schema,:
    <?xml version="1.0" encoding="AL32UTF8"?>
    <xsd:schema targetNamespace="schemastipostasa.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xdb="http://xmlns.oracle.com/xdb/XDBSchema.xsd"
    elementFormDefault="unqualified" version="1.0"
    attributeFormDefault="unqualified">
    <xsd:simpleType name="codigosType" xdb:SQLType="NUMBER(4)">
    <xsd:restriction base="xsd:positiveInteger" >
    <xsd:totalDigits value="4" />
    </xsd:restriction>
    </xsd:simpleType >
    <xsd:simpleType name="integerUnoType" xdb:SQLType="NUMBER(1)">
    <xsd:restriction base="xsd:int" >
    <xsd:totalDigits value="1" />
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="condicionType" xdb:SQLType="VARCHAR2(1)">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="S" >
    <xsd:annotation>
    <xsd:documentation>Condicion si es S</xsd:documentation>
    </xsd:annotation>
    </xsd:enumeration>
    <xsd:enumeration value="N" >
    <xsd:annotation>
    <xsd:documentation>Condicion no es N</xsd:documentation>
    </xsd:annotation>
    </xsd:enumeration>
    </xsd:restriction>
    </xsd:simpleType >
    </xsd:schema>
    I registred the schema written above with the folowwing pl*sql :
    DECLARE
    direc varchar2(2000);
    nombreArch BFILE;
    mens varchar2(2000);
    BEGIN
    direc:=uso_comun.pack_mail.fun_valor_param('TASA','DIR_DBSERVER');
    nombreArch:=bfilename(direc,'schemas_tipos_tasa.xsd');
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://xmlns.oracle.com/tasa/schemas.tipos.tasa.xsd',
    SCHEMADOC => nombreArch,
    LOCAL => TRUE,
    CSID => nls_charset_id('AL32UTF8'));
    dbms_lob.CLOSE(nombreArch);
    dbms_output.put_line('salio sin cancelar');
    exception
    when others then
    mens:=sqlerrm;
    dbms_lob.CLOSE(nombreArch);
    rollback;
    raise_application_error (-20001,'en registro shcema='||mens);
    END;
    Then, I want to register the following schema, that mention de schema above:
    <?xml version="1.0" encoding="AL32UTF8"?>
    <xsd:schema targetNamespace="schema.repuesto.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xdb="http://xmlns.oracle.com/xdb/XDBSchema.xsd"
    xmlns:tns="http://xmlns.oracle.com/tasa/schemas.tipos.tasa.xsd"
    elementFormDefault="qualified" version="1.0"
    attributeFormDefault="unqualified" >
    <xsd:element name="PRECIORENG" type="preciorepType" />
    <xsd:complexType name="preciorepType" >
    <xsd:sequence minOccurs="1" maxOccurs="unbounded">
    <xsd:element name="CODIGO_MARCA" type="tns:codigosType" />
    <xsd:element name="ORIGEN_PRECIO" type="tns:integerUnoType" />
    <xsd:element name="INGRESO_POR_FALTANTE" type="tns:condicionType" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    But when a run the following script whith the same db-user:
    DECLARE
    direc varchar2(2000);
    nombreArch BFILE;
    mens varchar2(2000);
    BEGIN
    direc:=uso_comun.pack_mail.fun_valor_param('TASA','DIR_DBSERVER');
    -- nombreArch:=bfilename(direc,'prueba_schema_seis.xsd');
    nombreArch:=bfilename(direc,'Schema_repuesto_nuevo.xsd');
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL =>'http://xmlns.oracle.com/tasa/schema.repuesto.xsd',
    SCHEMADOC => nombreArch,
    LOCAL => TRUE,
    CSID => nls_charset_id('AL32UTF8'));
    dbms_lob.CLOSE(nombreArch);
    dbms_output.put_line('salio sin cancelar');
    --commit;
    exception
    when others then
    mens:=sqlerrm;
    dbms_lob.CLOSE(nombreArch);
    rollback;
    raise_application_error (-20001,'en registro shcema='||mens);
    END;
    tell me the error: ORA: 01031, insufficient privileges!!!!, what’s wrong??,

    Hi,
    To register schema, you require XDBADMIN system privilege granted to the user.
    Please verify this and retry.
    Rgds,
    Rakesh Tripathi

  • The interface you are trying to use is related to a logical schema that no

    "The interface you are trying to use is related to a logical schema that no longer exists"
    I'm facing this error when importing a project on Designer connect to a new work repository.
    I have an TEST Data Integrator environment and now I need to move objects already created to a new DEV environment. I've created a new master and work repository with distinct ID's according note https://metalink.oracle.com/metalink/plsql/f?p=130:14:4335668333625114484::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,423815.1,1,1,1,helvetica
    Any ideas?
    Thanks

    Hi,
    Nothing occurs. My steps:
    1) Export Master Repository from 1st environment (topoloy -> export master repository)
    2) Create Master Repository on 2nd environment (through repcreate.bat)
    3) Export Topology (1st environment)
    4) Export all projects (1st environment)
    5) Import Topology (2nd environemtn) ----> com.sunopsis.core.n: This import action has been cancelled because it could damage your repository (problem with the identifier sequences)
    Is this sequence of operations correct?
    Thanks

  • Can i use App schema from another Oracle database.

    Hi everyone,
    can i use application schema from another Oracle database and how can we do this. the reason is that current database where apex is installed is get very slow because of the size of database and application usage.
    Regards,
    Kashif.

    user10485983 wrote:
    Please update your forum profile with a real handle instead of "user10485983".
    can i use application schema from another Oracle database and how can we do this. the reason is that current database where apex is installed is get very slow because of the size of database and application usage.
    You can (using database links), but this will generally result in even poorer performance (unless by "another Oracle database" you mean using RAC?)
    It sounds more like you either need to upgrade your systems, or refactor your applications to have a smaller performance footprint.

  • I plugged in my brand new nano to my husbands desktop to get it registered, but had a problem mid way through when I tried to used an apple login that already existed.  Now it's not registered and the computer won't recognize my device.  How do I fix this

    I plugged in my brand new nano to my husbands desktop to get it registered, but had a problem mid way through when I tried to used an apple login that already existed.  Now it's not registered and the computer won't recognize my device.  How do I fix this?

    iPod not recognized in 'My Computer' and in iTunes for Windows
    Call U.S. iPod and Mac technical support: 1-800-APL-CARE (1-800-275-2273) to register your iPod Nano.

  • I brought a macbook pro, but i can not use my apple id.because its already register onther account.i couldnt found that person.i want reset that account,can tell me how can i do this?

    i brought a macbook pro, but i can not use my apple id.because its already register onther account.i couldnt found that person.i want reset that account,can tell me how can i do this?

    maxsurovi wrote:
    i brought a macbook pro, but i can not use my apple id.because its already register onther account.i couldnt found that person.i want reset that account,can tell me how can i do this?
    Restore the Mac to Factorty settings to make it Truly Yours.
    Note:
    This should have been done before you took possession...
    Apple What to do before selling or giving away your Mac
    http://support.apple.com/kb/HT5189?viewlocale=en_US&locale=en_US
    Also See Thomas Reed's How to Prepare your Mac for sale

  • Exporting a schema on Linux Oracle XE using expdp

    Hi,
    Basically, I would like to take everything (including the APEX app) that's in the HR schema and copy into another schema. I want to experiment with APEX and don't want to mess around with the original. I'm running Oracle XE on Fedora 5 BTW.
    Here's what I did:
    CREATE OR REPLACE DIRECTORY backup_dir AS '/usr/lib/oracle/xe/app/oracle/admin/XE/';
    GRANT READ ON DIRECTORY backup_dir TO hr;
    But I can never get the expdp application to execute... (I'm new to linux btw)
    The path to the expdp binary is:
    /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin
    I then try to execute this comment in a terminal command line:
    ./expdp hr/hr SCHEMAS=hr DIRECTORY=backup_dir DUMPFILE=sch ema.dmp LOGFILE=schema.log;
    I get this message:
    UDE-00013: Message 13 not found; No message file for product=RDBMS, facility=UDE
    UDE-00019: You may need to set ORACLE_HOME to your Oracle software directory
    Eric

    Problem solved (almost) thanks!
    This export does not export the APEX application, I have to go into the APEX admin and export the application and then import it but everything else exported and imported fine.
    Here is the detailed solution:
    Create Backup Directory for Oracle:
    CREATE OR REPLACE DIRECTORY backup_dir AS '/usr/lib/oracle/xe/app/oracle/admin/XE/';
    Grant permissions to users:
    GRANT READ ON DIRECTORY backup_dir TO hr;
    Location of binaries on Linux:
    /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin
    To Export, cd to the binaries and execute in a linux terminal:
    ./expdp hr/hr@XE SCHEMAS=HR DIRECTORY=backup_dir DUMPFILE=schema.dmp LOGFILE=schema.log;
    Your export file will now be located at backup_dir '/usr/lib/oracle/xe/app/oracle/admin/XE/'
    To import, place the file in your backup_dir '/usr/lib/oracle/xe/app/oracle/admin/XE/' (If it's on the same computer you don't need to do anything since the file is already there) and then:
    impdp NewSchema/NewSchema@XE REMAP_SCHEMA=hr:NewSchema directory=backup_dir dumpfile=schema.dmp logfile=schema.log
    Thanks for your help!
    Eric

  • I have recently changed my mobile number, however when I use iMessage my old mobile number is still used. I realised that my old number is still registered to my iTunes account, how do I change this to my new number?

    I have recently changed my mobile number, however when I use iMessage my old mobile number is still used. I realised that my old number is still registered to my iTunes account, how do I change this to my new number

    See if this Link offers any enlightenment...
    Changing Account Information
    http://support.apple.com/kb/HT1918

  • Im trying to add an account to an iPad so that my messages send to my phone and not my brier e-mail that's already registered on the iPad. However when I enter a ne e-mail it's just saying "cannot be verified, e-mails already in  use??

    Im trying to add an account to an iPad so that my messages send to my phone and not my brothersr e-mail that's already registered on the iPad. However when I enter my e-mail it's just saying "cannot be verified, e-mails already in  use??

    You may have more than one Apple ID that shares the same email address.
    Try one of the following to resolve the issue:
    This error message means that your email address is already associated with another Apple ID. It could be tied to GameCenter, iTunes Store, or another Apple ID. Try using your Apple ID for those services to log in to FaceTime on your device.
    If you wish to use a separate Apple ID for FaceTime, unlink the email address from any other Apple ID before trying to set it up as a separate Apple ID for FaceTime.
    If you would like to change your Apple ID to another email address, go to My Apple ID and follow the instructions in this article to change your Apple ID.

  • Installed itunes, checked in, I try to download free applications out the window: this Apple ID has not yet been used with the iTunes Store. But the mail I receive, that I'm registered, and I have an Apple ID, please help find out!

    installed itunes, checked in, I try to download free applications out the window: this Apple ID has not yet been used with the iTunes Store. But the mail I receive, that I'm registered, and I have an Apple ID, please help find out!

    Diana,
    This could be a delay while internal service records were updated. Check it out again - is it okay for now?

  • ORA-31094 & ORA-31082 when registering Schemas generated w/generateSchema()

    I have genereated several Schemas using DBMS_XMLSCHEMA.generateSchema(). However, trying to register these Schemas results in error messages. The error messages state that "REF" and also my own Types were incompatible SQL-Types for an Attribute or Element (ORA-31094). Also, they state that "SQLSchema" was an invalid Attribute (ORA-31082).
    As an example, I have included one of the Schemas that has been generated, the procedure used to register it and and also the type OTYP_Artikel it has been generated from. I would like to know why the Schemas generated by Oracle contain these errors and how to fix this.
    declare
    doc varchar2(2000) := '<xsd:schema targetNamespace="http://ns.oracle.com/xdb/OO_CHEF" xmlns="http://ns.oracle.com/xdb/OO_CHEF" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/xdb http://xmlns.oracle.com/xdb/XDBSchema.xsd">
    <xsd:element name="OTYP_ARTIKEL" type="OTYP_ARTIKELType" xdb:SQLType="OTYP_ARTIKEL" xdb:SQLSchema="OO_CHEF"/>
    <xsd:complexType name="OTYP_ARTIKELType">
    <xsd:sequence>
    <xsd:element name="ARTIKEL_NR" type="xsd:string" xdb:SQLName="ARTIKEL_NR" xdb:SQLType="VARCHAR2"/>
    <xsd:element name="MWST" type="xsd:hexBinary" xdb:SQLName="MWST" xdb:SQLType="REF"/>
    <xsd:element name="BEZEICHNUNG" type="xsd:string" xdb:SQLName="BEZEICHNUNG" xdb:SQLType="VARCHAR2"/>
    <xsd:element name="LISTENPREIS" type="xsd:double" xdb:SQLName="LISTENPREIS" xdb:SQLType="NUMBER"/>
    <xsd:element name="BESTAND" type="xsd:double" xdb:SQLName="BESTAND" xdb:SQLType="NUMBER"/>
    <xsd:element name="MINDESTBESTAND" type="xsd:double" xdb:SQLName="MINDESTBESTAND" xdb:SQLType="NUMBER"/>
    <xsd:element name="VERPACKUNG" type="xsd:string" xdb:SQLName="VERPACKUNG" xdb:SQLType="VARCHAR2"/>
    <xsd:element name="LAGERPLATZ" type="xsd:double" xdb:SQLName="LAGERPLATZ" xdb:SQLType="NUMBER"/>
    <xsd:element name="KANN_WEGFALLEN" type="xsd:double" xdb:SQLName="KANN_WEGFALLEN" xdb:SQLType="NUMBER"/>
    <xsd:element name="BESTELLVORSCHLAG" type="xsd:date" xdb:SQLName="BESTELLVORSCHLAG" xdb:SQLType="DATE"/>
    <xsd:element name="NACHBESTELLUNG" type="xsd:date" xdb:SQLName="NACHBESTELLUNG" xdb:SQLType="DATE"/>
    <xsd:element name="NACHBESTELLMENGE" type="xsd:double" xdb:SQLName="NACHBESTELLMENGE" xdb:SQLType="NUMBER"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>';
    begin
    dbms_xmlschema.registerSchema('http://www.oracle.com/best.xsd', doc);
    end;
    DROP TABLE otab_artikel
    DROP TABLE otab_mwstsatz
    DROP TYPE otyp_artikel
    DROP TYPE otyp_mwstsatz
    CREATE OR REPLACE TYPE otyp_mwstsatz AS OBJECT (
    mwst integer,
    prozent number (3,3),
    beschreibung varchar2(10),
    MAP MEMBER FUNCTION mwst_order RETURN REAL,
    PRAGMA RESTRICT_REFERENCES
    (mwst_order, RNDS, WNDS, RNPS, WNPS),
    STATIC FUNCTION construct_mwst (in_mwst IN INTEGER,
    in_prozent IN NUMBER, in_beschreib IN VARCHAR2)
    RETURN otyp_mwstsatz
    show errors
    CREATE OR REPLACE TYPE BODY otyp_mwstsatz AS
    MAP MEMBER FUNCTION mwst_order RETURN REAL IS
    BEGIN
    RETURN prozent;
    END mwst_order;
    STATIC FUNCTION construct_mwst (in_mwst IN INTEGER,
    in_prozent IN NUMBER,
    in_beschreib IN VARCHAR2)
    RETURN otyp_mwstsatz IS
    BEGIN
    IF in_mwst < 0 THEN
    DBMS_OUTPUT.PUT_LINE ('Mwst-Schluessel muss >=0 sein');
    raise_application_error(-1,'Wertfehler bei mwst',FALSE);
    ELSE
    RETURN otyp_mwstsatz(in_mwst,in_prozent,in_beschreib);
    END IF;
    END construct_mwst;
    END;
    show errors
    CREATE TABLE otab_mwstsatz OF otyp_mwstsatz
    mwst NOT NULL,
    prozent NOT NULL,
    CONSTRAINT pk_mwstsatz PRIMARY KEY (mwst)
    CREATE OR REPLACE TYPE otyp_artikel AS OBJECT (
    artikel_nr varchar2(4),
    mwst REF otyp_mwstsatz,
    bezeichnung varchar2(15),
    listenpreis number(8,2),
    bestand number(5,0),
    mindestbestand number (5,0),
    verpackung varchar2(15),
    lagerplatz number(2,0),
    kann_wegfallen number(1,0),
    bestellvorschlag date,
    nachbestellung date,
    nachbestellmenge number(5,0),
    MEMBER FUNCTION get_mwst RETURN REAL,
    PRAGMA RESTRICT_REFERENCES (get_mwst, WNDS, WNPS)
    show errors
    CREATE OR REPLACE TYPE BODY otyp_artikel AS
    MEMBER FUNCTION get_mwst RETURN REAL IS
    lvar_prozent NUMBER(3,3);
    lvar_mwst otyp_mwstsatz;
    BEGIN
    SELECT DEREF(mwst) INTO lvar_mwst
    FROM dual;
    lvar_prozent := lvar_mwst.prozent;
    RETURN lvar_prozent;
    END get_mwst;
    END;
    show errors
    CREATE TABLE otab_artikel OF otyp_artikel (
    CONSTRAINT pk_artikel PRIMARY KEY (artikel_nr),
    CONSTRAINT nn_mwst mwst NOT NULL,
    CONSTRAINT nn_bezeichnung bezeichnung NOT NULL,
    CONSTRAINT nn_listenpreis listenpreis NOT NULL,
    CONSTRAINT nn_bestand bestand NOT NULL,
    CONSTRAINT chk_bestand CHECK (bestand >= 0),
    CONSTRAINT nn_mindestbestand mindestbestand NOT NULL,
    CONSTRAINT chk_mindestbestand CHECK (mindestbestand >= 0),
    CONSTRAINT chk_nachbestell
    CHECK (nachbestellmenge IS NULL OR nachbestellmenge >= 0)
    );

    Please post your question to XML DB forum for further help.

  • Oracle's Schema Processor is failing to catch errors

    I tried validating an XML document with known errors against a valid schema using Oracle's Schema Processor v0_9_0_0 and did not get the expected results.
    I used the following test file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Cars xmlns = "http://www.CarDealers.com/"
    xmlns:xsi = "http://www.w3.org/1999/XMLSchema/instance"
    xsi:schemaLocation = "http://www.CarDealers.com/ Store.xsd" RequestDate="ashd">
    <Model>Ford</Model>
    <Make>ExplorerExpeditionTaurusF150Escort</Make>
    <Year>1999</Year>
    <OwnerName>Joe Smith</OwnerName>
    <OwnerName>Bob Jones</OwnerName>
    <Condition Automatic="NA">Small dent on right bumper.</Condition>
    <Mileage>400000000</Mileage>
    </CarDealers>
    And validated the sample against the following schema:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <schema xmlns = "http://www.w3.org/1999/XMLSchema"
    targetNamespace = "http://www.CarDealers.com/">
    <element name="Car">
    <complexType>
    <element name="Model">
    <simpleType base="string">
    <enumeration value = "Ford"/>
    <enumeration value = "Saab"/>
    <enumeration value = "Audi"/>
    </simpleType>
    </element>
    <element name="Make">
    <simpleType base="string">
    <minLength value = "1"/>
    <maxLength value = "30"/>
    </simpleType>
    </element>
    <element name="Year">
    <complexType content="mixed">
    <attribute name="PreviouslyOwned" type="string" use="required"/>
    <attribute name="YearsOwned" type="integer" use="optional"/>
    </complexType>
    </element>
    <element name="OwnerName" minOccurs="0" maxOccurs="unbounded"/>
    <element name="Condition">
    <complexType base="string" derivedBy="extension">
    <attribute name="Automatic">
    <simpleType base="string">
    <enumeration value = "Yes"/>
    <enumeration value = "No"/>
    </simpleType>
    </attribute>
    </complexType>
    </element>
    <element name="Mileage">
    <simpleType base="integer">
    <minInclusive value="0"/>
    <maxInclusive value="20000"/>
    </simpleType>
    </element>
    <attribute name="RequestDate" type="date"/>
    </complexType>
    </element>
    </schema>
    The Oracle parser did not recognize the W3C facet syntax of minLength and maxLength; the file would pass validation if I changed the syntax to minlength and maxlength.
    The Oracle parser did not recoginze the W3C "use=" syntax used for attribute occurrences; the file would pass validation if I changed the syntax to minOccurs and maxOccurs which should be used for element validation only.
    The Oracle parser did not recoginze the W3C "unbounded" syntax used to define max occurrences of elements; the file would pass validation if I changed the syntax to maxOccurs="*" .
    The element "Year" was defined with a required attribute, PreviouslyOwned. However, the sample file is missing both the PreviouslyOwned and optional YearsOwned attributes and passes validation. It appears that the parser does not validate the presence of a required attribute unless another attribute is present for the element, e.g. if the optional YearsOwned attribute was in the file the parser would then catch that the PreviouslyOwned attribute was missing.
    The sample file validated with an incorrect value of "ashd" for the RequestDate element, so it appears the "date" data type is not supported.
    The parser does not recognize the "derivedBy" syntax used to define the Condition element. How else can you define the constraints for an elements value and attributes?
    Based on some additional testing it appears that the Oracle parser cannot handle more than 4 or 5 include statements to reference other schemas.
    Are these known bugs in the Oracle parser? Has Oracle issued any updates to this initial release? Are there any settings I should be aware of that may provide full er validation?
    null

    Hi OTM,
    One of our Integration Subsystem is heavily depend on the schema processor for XML validation. 0.9 release - eventhough it is an Alpha, has proven to be very helpfull for us. We are looking forward to use the final release of this product, and expect it will completely support the W3C Schema Spec. I'm wondering when will be final relase availabe? Could you please give us a time limit for the new release? Thanks.
    Shankar
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Oracle XML Team:
    The current release is the initial one that is incomplete. Our second release is scheduled for the end of the month and will be much better.
    Oracle XML Team<HR></BLOCKQUOTE>
    null

Maybe you are looking for