Ora-30930 by uploading schema based xml file

i got an ora-30930 xml node 'mst' (type = attribute)
does not support operation.
I got this after i try to convert the schema from structured to unstructured storage
<xs:attribute name="mst" type="xs:dateTime" use="required"/>

i got an ora-30930 xml node 'mst' (type = attribute)
does not support operation.
I got this after i try to convert the schema from structured to unstructured storage
<xs:attribute name="mst" type="xs:dateTime" use="required"/>

Similar Messages

  • Cant load schema-based xml-file to default table via http/ftp

    Hola,
    we are running ORACLE 10.2.0.3.0 with installed XML-DB.
    HTTP- and ftp-listeners where configured successfully, we are able to register a designed XSD-file within XML-DB. Autogen types and tables where set "true" and default table for root object within xsd and several type objects where also created successful.
    Oracle DB is running on a Linux environment, it is possible to establish a WEBDAV-connection to this machine via my Windows client.
    As far as I understood the Oracle examples, there should be some kind of automatism. Putting a valid (and registered via xsi:noNamespaceSchemaLocation=<pointing to xsd-file>) XML file into my WEBDAV folder should create an XML object in the XML repository AND create a dataset in the default table.
    Last thing doesn´t work.
    Any idea?!

    Can you try this simple example
    SQL> set echo on
    SQL> spool testase.log
    SQL> --
    SQL> connect / as sysdba
    Connected.
    SQL> --
    SQL> set define on
    SQL> set timing on
    SQL> --
    SQL> define USERNAME = OTN
    SQL> --
    SQL> def PASSWORD = &USERNAME
    SQL> --
    SQL> def USER_TABLESPACE = USERS
    SQL> --
    SQL> def TEMP_TABLESPACE = TEMP
    SQL> --
    SQL> drop user &USERNAME cascade
      2  /
    old   1: drop user &USERNAME cascade
    new   1: drop user OTN cascade
    User dropped.
    Elapsed: 00:00:00.18
    SQL> grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASSWORD
      2  /
    old   1: grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASSWORD
    new   1: grant create any directory, drop any directory, connect, resource, alter session, create view to OTN identified by OTN
    Grant succeeded.
    Elapsed: 00:00:00.09
    SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
      2  /
    old   1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
    new   1: alter user OTN default tablespace USERS temporary tablespace TEMP
    User altered.
    Elapsed: 00:00:00.00
    SQL> connect &USERNAME/&PASSWORD
    Connected.
    SQL> --
    SQL> -- create or replace directory XMLDIR as '&XMLDIR'
    SQL> -- /
    SQL> var SCHEMAURL    varchar2(256)
    SQL> VAR XMLSCHEMA    CLOB;
    SQL> VAR INSTANCE     CLOB;
    SQL> VAR DOCPATH      VARCHAR2(700)
    SQL> --
    SQL> set define off
    SQL> --
    SQL> alter session set events='31098 trace name context forever'
      2  /
    Session altered.
    Elapsed: 00:00:00.01
    SQL> begin
      2    :SCHEMAURL:= 'http://oradb4.min.local:8080/public/CSBF/xsd/CSBF_Vergabemeldung_Formular.xsd';
      3    :XMLSCHEMA :=
      4  '<?xml version="1.0" encoding="UTF-8"?>
      5  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
      6     <xs:simpleType name="string_5">
      7             <xs:restriction base="xs:string"><xs:maxLength value="5"/></xs:restriction>
      8     </xs:simpleType>
      9     <xs:simpleType name="string_6">
    10             <xs:restriction base="xs:string"><xs:maxLength value="6"/></xs:restriction>
    11     </xs:simpleType>
    12     <xs:simpleType name="string_8">
    13             <xs:restriction base="xs:string"><xs:maxLength value="8"/></xs:restriction>
    14     </xs:simpleType>
    15     <xs:simpleType name="string_20">
    16             <xs:restriction base="xs:string"><xs:maxLength value="20"/></xs:restriction>
    17     </xs:simpleType>
    18     <xs:simpleType name="string_30">
    19             <xs:restriction base="xs:string"><xs:maxLength value="30"/></xs:restriction>
    20     </xs:simpleType>
    21     <xs:simpleType name="string_60">
    22             <xs:restriction base="xs:string"><xs:maxLength value="60"/></xs:restriction>
    23     </xs:simpleType>
    24     <xs:element name="CSBF_Vergabemeldung" xdb:defaultTable="CSBF_VERGABE_INFO_XML">
    25             <xs:complexType>
    26                     <xs:sequence>
    27                             <xs:element name="CSBF_Vergabemeldung_Info">
    28                                     <xs:complexType>
    29                                             <xs:sequence>
    30                                                     <xs:element name="Identnummer" type="string_30"/>
    31                                                     <xs:element name="Version_CSBF_Vergabevermerk_Formular" type="string_30"/>
    32                                                     <xs:element name="Fertigstellung_Vergabevermerk" type="xs:date"/>
    33                                             </xs:sequence>
    34                                     </xs:complexType>
    35                             </xs:element>
    36                             <xs:element name="Strassenbaudienststelle">
    37                                     <xs:complexType>
    38                                             <xs:sequence>
    39                                                     <xs:element name="Kennung" type="string_8"/>
    40                                                     <xs:element name="Strassenbau_Organisation_Bezeichnung" type="string_60"/>
    41                                                     <xs:element name="Adresszeile_2" type="string_60" minOccurs="0"/>
    42                                                     <xs:element name="Adresszeile_3" type="string_60" minOccurs="0"/>
    43                                                     <xs:element name="Adresszeile_4" type="string_60" minOccurs="0"/>
    44                                                     <xs:element name="Strasse" type="string_60"/>
    45                                                     <xs:element name="PLZ" type="string_6"/>
    46                                                     <xs:element name="Ort" type="string_60"/>
    47                                                     <xs:element name="NUTS" type="string_5"/>
    48                                                     <xs:element name="Telefon" type="string_20" minOccurs="0"/>
    49                                                     <xs:element name="Fax" type="string_20" minOccurs="0"/>
    50                                                     <xs:element name="E_Mail" type="string_30"/>
    51                                             </xs:sequence>
    52                                     </xs:complexType>
    53                             </xs:element>
    54                     </xs:sequence>
    55             </xs:complexType>
    56     </xs:element>
    57  </xs:schema>';
    58    :DOCPATH := '/public/CSBF_Vergabemeldung.xml';
    59    :INSTANCE :=
    60  '<?xml version="1.0" encoding="ISO-8859-15"?>
    61  <CSBF_Vergabemeldung xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://oradb4.min.local:8080/public/CSBF/xsd/CSBF
    _Vergabemeldung_Formular.xsd">
    62     <CSBF_Vergabemeldung_Info>
    63             <Identnummer>xxxxxxxxxxxxxxxxxxxxxxxxxxxxx</Identnummer>
    64             <Version_CSBF_Vergabevermerk_Formular>xxxxxxxxxxxxxxxx</Version_CSBF_Vergabevermerk_Formular>
    65             <Fertigstellung_Vergabevermerk>1900-01-01</Fertigstellung_Vergabevermerk>
    66     </CSBF_Vergabemeldung_Info>
    67     <Strassenbaudienststelle>
    68             <Kennung>xxxxx</Kennung>
    69             <Strassenbau_Organisation_Bezeichnung>xxxxxxx</Strassenbau_Organisation_Bezeichnung>
    70             <Adresszeile_2>xxxxxxxxxxxxx</Adresszeile_2>
    71             <Adresszeile_3>xxxxxxxxxxxxxx</Adresszeile_3>
    72             <Adresszeile_4>xxxxxxxxxxxxxxxxx</Adresszeile_4>
    73             <Strasse>xxxxxxxxxxxxxx</Strasse>
    74             <PLZ>xxxxx</PLZ>
    75             <Ort>xxxxxxxxxxxxxx</Ort>
    76             <NUTS>xxxxx</NUTS>
    77             <Telefon>xxxxxxxxxxx</Telefon>
    78             <Fax>xxxxxxxxxxx</Fax>
    79             <E_Mail>[email protected]</E_Mail>
    80     </Strassenbaudienststelle>
    81  </CSBF_Vergabemeldung>';
    82  end;
    83  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      schemaurl       => :SCHEMAURL,
      5      schemadoc       => :XMLSCHEMA,
      6      local           => TRUE,
      7      genTypes        => TRUE,
      8      genBean         => FALSE,
      9      genTables       => TRUE
    10    );
    11  end;
    12  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:03.80
    SQL> desc CSBF_VERGABE_INFO_XML
    Name                                                                                      Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://oradb4.min.local:8080/public/CSBF/xsd/CSBF_Vergabemeldung_Formular.xsd" Element "CSBF_Vergabemeldung") STORAGE Object-rel
    ational TYPE "CSBF_Vergabemeldung3270_T"
    SQL> --
    SQL> declare
      2    V_RESULT BOOLEAN;
      3  begin
      4     if dbms_xdb.existsResource(:DOCPATH) then
      5       dbms_xdb.deleteResource(:DOCPATH);
      6    end if;
      7    V_RESULT := DBMS_XDB.CREATERESOURCE(:DOCPATH,:INSTANCE);
      8    COMMIT;
      9  end;
    10  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.79
    SQL> select count(*)
      2    from CSBF_VERGABE_INFO_XML
      3  /
             1
    Elapsed: 00:00:00.15
    SQL> set long 10000 pages 0 lines 160
    SQL> --
    SQL> select object_value
      2    from CSBF_VERGABE_INFO_XML
      3  /
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <CSBF_Vergabemeldung xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://oradb4.min.local:8080/public/CSBF/xsd/CSBF_Verg
    abemeldung_Formular.xsd">
      <CSBF_Vergabemeldung_Info>
        <Identnummer>xxxxxxxxxxxxxxxxxxxxxxxxxxxxx</Identnummer>
        <Version_CSBF_Vergabevermerk_Formular>xxxxxxxxxxxxxxxx</Version_CSBF_Vergabevermerk_Formular>
        <Fertigstellung_Vergabevermerk>1900-01-01</Fertigstellung_Vergabevermerk>
      </CSBF_Vergabemeldung_Info>
      <Strassenbaudienststelle>
        <Kennung>xxxxx</Kennung>
        <Strassenbau_Organisation_Bezeichnung>xxxxxxx</Strassenbau_Organisation_Bezeichnung>
        <Adresszeile_2>xxxxxxxxxxxxx</Adresszeile_2>
        <Adresszeile_3>xxxxxxxxxxxxxx</Adresszeile_3>
        <Adresszeile_4>xxxxxxxxxxxxxxxxx</Adresszeile_4>
        <Strasse>xxxxxxxxxxxxxx</Strasse>
        <PLZ>xxxxx</PLZ>
        <Ort>xxxxxxxxxxxxxx</Ort>
        <NUTS>xxxxx</NUTS>
        <Telefon>xxxxxxxxxxx</Telefon>
        <Fax>xxxxxxxxxxx</Fax>
        <E_Mail>[email protected]</E_Mail>
      </Strassenbaudienststelle>
    </CSBF_Vergabemeldung>
    Elapsed: 00:00:01.99
    SQL> select xdburitype(:DOCPATH).getXML()
      2    from DUAL
      3  /
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <CSBF_Vergabemeldung xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://oradb4.min.local:8080/public/CSBF/xsd/CSBF_Verg
    abemeldung_Formular.xsd">
      <CSBF_Vergabemeldung_Info>
        <Identnummer>xxxxxxxxxxxxxxxxxxxxxxxxxxxxx</Identnummer>
        <Version_CSBF_Vergabevermerk_Formular>xxxxxxxxxxxxxxxx</Version_CSBF_Vergabevermerk_Formular>
        <Fertigstellung_Vergabevermerk>1900-01-01</Fertigstellung_Vergabevermerk>
      </CSBF_Vergabemeldung_Info>
      <Strassenbaudienststelle>
        <Kennung>xxxxx</Kennung>
        <Strassenbau_Organisation_Bezeichnung>xxxxxxx</Strassenbau_Organisation_Bezeichnung>
        <Adresszeile_2>xxxxxxxxxxxxx</Adresszeile_2>
        <Adresszeile_3>xxxxxxxxxxxxxx</Adresszeile_3>
        <Adresszeile_4>xxxxxxxxxxxxxxxxx</Adresszeile_4>
        <Strasse>xxxxxxxxxxxxxx</Strasse>
        <PLZ>xxxxx</PLZ>
        <Ort>xxxxxxxxxxxxxx</Ort>
        <NUTS>xxxxx</NUTS>
        <Telefon>xxxxxxxxxxx</Telefon>
        <Fax>xxxxxxxxxxx</Fax>
        <E_Mail>[email protected]</E_Mail>
      </Strassenbaudienststelle>
    </CSBF_Vergabemeldung>
    Elapsed: 00:00:00.11
    SQL>

  • Delete schema based xml fails

    I am attempting to delete xml files through the following command:
    delete from
    (select 1 from resource_view
    where UNDER_PATH(res, '/home/user1/forms', 1) = 1
    order by depth(1) desc);
    /home/user1/forms contains over 200,000 schema-based xml documents that I wish to drop. The schema-based documents previously were loaded properly and showed 0kb size. Their contents are accessible from views and can be used in sql statements.
    The command has been running over 24 hours with the server's cpu maxed at 100%. The server is Windows Server 2003 and the database is 9.2.0.4. There are no relevant invalid objects in the database.
    Could the command be failing (or simply taking a really, really long time) because I should not have loaded all the forms into a single folder? I have been able to run the above command on folders with 5 or ten xml documents in them.

    Hi people,
    Our results (YMMV - and if it does then tell us how) made us VERY reluctant to drop structures that weren't empty - period.
    Try it for yourselves but our experience was basically any live dropping of XML schema structures has a fairly good chance of being incomplete or not allowing the same schema to be reconstituted in a lights-out environment... (ie. didn't completely remove types / tables from dictionary so we got "<name> already exists" errors on schema re-registration, requiring an instance restart - but with no guarantees ).
    BTW : DELETE FROM gives MASSIVE amounts of redo ...and takes MASSIVE amounts of time with the hierarchy triggers enabled [I suspect the moderately evil UNDER_PATH operator is hidden in the delete hierarchy trigger] (hence the copy out stuff to be kept - then TRUNCATE option).
    And with schema mapped hierarchy enabled structures - dropping the tables left dangling pointers from the resource entry to the now non-existent schema table structures. These dangling pointers destroyed access to that set of resources (and any resources PAST evaluation of those rows in RESOURCE_VIEW [a previous rant of mine on "exception objects" explains why]. (Until a dbms_xdb.deleteresource( <path>, dbms_xdb.*force) was used on each resource).
    So to update or extend our hierarchy enabled schema our recipe became :
    Disable receiver processes
    Disable hierarchy triggers
    for r in
    ( select *
    from resource_view r
    where r.any_path like || '<app_root>/%'
    order by instr( r.any_path, '.' ) desc
    -- hack to delete files before folders
    loop
    dbms_xdb.deleteresource(
    r.any_path,
    dbms_xdb.delete_resource
    end loop;
    Delete the rows from the xml type tables. (TRUNCATE each table from bottom up).
    Drop the schema with dbms_xmlschema.delete_invalidate;
    Drop all xml related user types and tables (by naming convention in our XML Schema xdb:SQLType* / xdb:SQLName* attributes).
    Register new schema and transform / insert stored XML values into tables again.
    NOTE : In our case we copy those rows / resources we need to keep to other CLOB based structures first and reconstitute them after the schema is back - thankfully our profile allows this.
    Hope this helps,
    Lachlan

  • Schema based xml db

    how to create schema based xml database..i have tried but showing errors
    how to register the xml schema......

    LOL - "being the ACE" - hereby some of the things you could do
    an example
    clear screen
    -- Drop user TEST if it exists - Cleaning Up First
    conn / as sysdba
    set echo on
    set termout on
    set feed on
    drop user test cascade;
    purge dba_recyclebin;
    create user test identified by test;
    grant xdbadmin, dba to test;
    connect test/test
    set echo on
    set termout on
    set feed on
    var schemaPath varchar2(256)
    var schemaURL  varchar2(256)
    pause
    clear screen
    begin
      :schemaURL := 'http://www.myserver.com/root.xsd';
      :schemaPath := '/public/root.xsd';
    end;
    -- Create an XML Schema root.xsd in directory /public/
    declare
      res boolean;
      xmlSchema xmlType := xmlType(
    '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xdb="http://xmlns.oracle.com/xdb"
                xmlns="http://www.myserver.com/root.xsd" targetNamespace="http://www.myserver.com/root.xsd"
                elementFormDefault="qualified"
                attributeFormDefault="unqualified"
                xdb:storeVarrayAsTable="true">
    <xs:element name="ROOT" xdb:defaultTable="ROOT_TABLE" xdb:maintainDOM="false">
      <xs:annotation>
       <xs:documentation>Example XML Schema</xs:documentation>
      </xs:annotation>
      <xs:complexType xdb:maintainDOM="false">
       <xs:sequence>
        <xs:element name="ID" type="xs:integer" xdb:SQLName="ID"/>
        <xs:element ref="INFO" xdb:SQLInline="false" />
       </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name="INFO" xdb:SQLName="INFO_TYPE">
      <xs:complexType xdb:maintainDOM="false">
       <xs:sequence>
        <xs:element name="INFO_ID" type="xs:integer" xdb:SQLName="TYPE_INFO_ID"/>
        <xs:element name="INFO_CONTENT"
                    xdb:SQLName="TYPE_INFO_CONTENT" type="xs:string"/>
       </xs:sequence>
      </xs:complexType>
    </xs:element>
    </xs:schema>');
    begin
    if (dbms_xdb.existsResource(:schemaPath)) then
        dbms_xdb.deleteResource(:schemaPath);
    end if;
    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    end;
    pause
    clear screen
    -- Selecting repository files and folders via XDBUriType
    select xdbURIType ('/public/root.xsd').getClob()
    from   dual;
    pause
    clear screen
    begin
      :schemaURL := 'http://www.myserver.com/root.xml';
      :schemaPath := '/public/root.xml';
    end;
    -- Create an XML Document root.xml in directory /public/
    declare
      res boolean;
      xmlSchema xmlType := xmlType(
    '<?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns="http://www.myserver.com/root.xsd">
    <ID>0</ID>
    <INFO>
       <INFO_ID>0</INFO_ID>
       <INFO_CONTENT>Text</INFO_CONTENT>
    </INFO>
    </ROOT>');
    begin
    if (dbms_xdb.existsResource(:schemaPath)) then
        dbms_xdb.deleteResource(:schemaPath);
    end if;
    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    end;
    pause
    clear screen
    -- Selecting repository files and folders via XDBUriType
    select xdbURIType ('/public/root.xml').getClob()
    from   dual;
    pause
    clear screen
    -- Delete an XML schema in the registry if it exists
    call DBMS_XMLSCHEMA.deleteSchema('http://www.myserver.com/root.xsd', 4);
    commit;
    select * from tab;
    alter session set events='31098 trace name context forever';
    BEGIN
    DBMS_XMLSCHEMA.registerSchema
    (SCHEMAURL => 'http://www.myserver.com/root.xsd',
      SCHEMADOC => xdbURIType('/public/root.xsd').getClob(),
      LOCAL     => FALSE, -- local
      GENTYPES  => TRUE,  -- generate object types
      GENBEAN   => FALSE, -- no java beans
      GENTABLES => TRUE,  -- generate object tables
      OWNER     => USER
    END;
    commit;
    select * from tab;
    pause
    clear screen
    -- Insert some data with XDBURIType
    DECLARE
       XMLData xmlType := xmlType(xdbURIType ('/public/root.xml').getClob());
    BEGIN
      for i in 1..10
      loop
          insert into ROOT_TABLE
          VALUES
          (XMLData);
      end loop;
    END;
    commit;
    -- randomize the data a little
    update ROOT_TABLE
    set object_value = updateXML(object_value,
                                '/ROOT/ID/text()',
                                substr(round(dbms_random.value*100),0,2)
    update ROOT_TABLE
    set object_value = updateXML(object_value,
                                '/ROOT/INFO/INFO_ID/text()',
                                substr(round(dbms_random.value*100),0,2)
    commit;
    pause
    clear screen
    -- End Result
    select count(*) from root_table;
    select * from root_table where rownum < 5;

  • Inserting a row in a schema-based xml type column

    i have problems while inserting a row in a schema-based xml type column
    it reports an error(schema and elemnt do not match)
    although they are matching if anyone can try it
    and if it worked plz send me the example

    SQL> DESC XML_TAB;
    Name Null? Type
    XML XMLTYPE
    SQL> INSERT INTO XML_TAB
    2 VALUES
    3 (xmltype('<request>
    4 <filter>(extshortname=bhagat)</filter>
    5 <attributes>dn</attributes>
    6 <context/>
    7 <scope>subtree</scope>
    8 </request>'));
    1 row created.
    If your problem persists,post ur lines of code..
    Good luck!!!
    Bhagat

  • Performance on  Schema based Xml and No Schema based XML

    Hai,
    We can insert two kind of xml like schema based xml document and non schema based xml document into XMLTYPE fields.I like to know which xml document will have good performance ( fast access ) compare to another.
    Even if we have any other approach than schema.It will be great.
    We do XPath query to get the values from xml document.Is there any way to get the fields faster than the XPath.I am using Oracle 10g R2.
    I need to access much fast the xml element from the table.Please help me!.
    Thanks,
    Saravanan.P

    HHave you read the FAQ or any of the XML DB whitepapers... If not I suggest that you do so before proceeding any further or asking any more questions. If you take the time to a do a little basic research you should be able to see that you have made the worst possible decision if performance is importantto you.
    If you invested a little bit of effort before posting you would soon understand that in 10gR2 you will need to use schema based storage to get high performance, and that it doesn't matter whether you use XPath or XQuery, what matters is whether or not the XPath or XQuery operations get re-written correctly so the database can optimize them.

  • Getting ORA-22805 when trying to load XML file using SQLLDR

    I'm trying to learn the basics of XML since we'll be getting XML files in the near future. I'm using one of the sample schemas that comes with XMLSPY. I loaded this schema into an 11g Oracle DB using XMLSPY:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XML Spy v4.0 NT beta 1 build Jun 13 2001 (http://www.xmlspy.com) by Alexander Falk (Altova, Inc.) -->
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ipo="http://www.altova.com/IPO" targetNamespace="http://www.altova.com/IPO" elementFormDefault="unqualified" attributeFormDefault="unqualified">
         <annotation>
              <documentation>
    International Purchase order schema for Example.com
    Copyright 2000 Example.com. All rights reserved.
    </documentation>
         </annotation>
         <!-- include address constructs -->
         <include schemaLocation="address.xsd"/>
         <element name="purchaseOrder" type="ipo:PurchaseOrderType"/>
         <element name="comment" type="string"/>
         <complexType name="PurchaseOrderType">
              <sequence>
                   <element name="shipTo" type="ipo:Address"/>
                   <element name="billTo" type="ipo:Address"/>
                   <element ref="ipo:comment" minOccurs="0"/>
                   <element name="Items" type="ipo:Items"/>
              </sequence>
              <attribute name="orderDate" type="date"/>
         </complexType>
         <complexType name="Items">
              <sequence>
                   <element name="item" minOccurs="0" maxOccurs="unbounded">
                        <complexType>
                             <sequence>
                                  <element name="productName" type="string"/>
                                  <element name="quantity">
                                       <simpleType>
                                            <restriction base="positiveInteger">
                                                 <maxExclusive value="100"/>
                                            </restriction>
                                       </simpleType>
                                  </element>
                                  <element name="price" type="decimal"/>
                                  <element ref="ipo:comment" minOccurs="0"/>
                                  <element name="shipDate" type="date" minOccurs="0"/>
                             </sequence>
                             <attribute name="partNum" type="ipo:Sku"/>
                        </complexType>
                   </element>
              </sequence>
         </complexType>
         <simpleType name="Sku">
              <restriction base="string">
                   <pattern value="\d{3}-[A-Z]{2}"/>
              </restriction>
         </simpleType>
    </schema>
    Then I created an XMLType table:
    CREATE TABLE purchaseOrder OF XMLType
    XMLSCHEMA "ipo.xsd" ELEMENT "purchaseOrder"
    I'm trying to load the sample XML file ipo.xml into purchaseOrder using SQLLDR. This is ipo.xml:
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Mr. Nobody (Altova GmbH) -->
    <ipo:purchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ipo="http://www.altova.com/IPO" orderDate="1999-12-01" xsi:schemaLocation="http://www.altova.com/IPO
    ipo.xsd">
         <shipTo export-code="1" xsi:type="ipo:EU-Address">
              <ipo:name>Helen Zoe</ipo:name>
              <ipo:street>47 Eden Street</ipo:street>
              <ipo:city>Cambridge</ipo:city>
              <ipo:postcode>126</ipo:postcode>
         </shipTo>
         <billTo xsi:type="ipo:US-Address">
              <ipo:name>Robert Smith</ipo:name>
              <ipo:street>8 Oak Avenue</ipo:street>
              <ipo:city>Old Town</ipo:city>
              <ipo:state>AK</ipo:state>
              <ipo:zip>95819</ipo:zip>
         </billTo>
         <Items>
              <item partNum="833-AA">
                   <productName>Lapis necklace</productName>
                   <quantity>2</quantity>
                   <price>99.95</price>
                   <ipo:comment>Need this for the holidays!</ipo:comment>
                   <shipDate>1999-12-05</shipDate>
              </item>
              <item partNum="748-OT">
                   <productName>Diamond heart</productName>
                   <quantity>1</quantity>
                   <price>248.90</price>
                   <ipo:comment>Valentine's day packaging.</ipo:comment>
                   <shipDate>2000-02-14</shipDate>
              </item>
              <item partNum="783-KL">
                   <productName>Uncut diamond</productName>
                   <quantity>7</quantity>
                   <price>79.90</price>
                   <shipDate>2000-01-07</shipDate>
              </item>
              <item partNum="238-KK">
                   <productName>Amber ring</productName>
                   <quantity>3</quantity>
                   <price>89.90</price>
                   <ipo:comment>With no inclusions, please.</ipo:comment>
                   <shipDate>2000-01-07</shipDate>
              </item>
              <item partNum="229-OB">
                   <productName>Pearl necklace</productName>
                   <quantity>1</quantity>
                   <price>4879.00</price>
                   <shipDate>1999-12-05</shipDate>
              </item>
              <item partNum="128-UL">
                   <productName>Jade earring</productName>
                   <quantity>5</quantity>
                   <price>179.90</price>
                   <shipDate>2000-02-14</shipDate>
              </item>
         </Items>
    </ipo:purchaseOrder>
    This is what's in the control file:
    LOAD DATA
    INFILE *
    INTO TABLE purchaseOrder TRUNCATE
    xmltype(xmldata)
    FIELDS
    xmldata LOBFILE (CONSTANT ipo.xml)
    BEGINDATA
    0
    The load fails with:
    Record 1: Rejected - Error on table PURCHASEORDER.
    ORA-22805: cannot insert NULL object into object tables or nested tables
    Another question I have is, how do we know how many records (0's) to specify in the control file? In this case there's only one but when real files are used we won't know how many are in the file.
    Thanks for your help!

    The concept was "Don't use SQL*Loader to parse XML".
    You can use SQL*Loader to load an entire XML document into the DB. That is fine. You can do the same via BFILENAME to read in files from disk as well.
    If you want to parse XML, do that from within Oracle via PL/SQL and/or SQL. The solution depends upon your version of Oracle and what is good enough for you in terms of performance.
    So the basics are
    a) How am I getting the information?
    b) How am I getting in into Oracle?
    c) How do I want to parse it?
    As I see the schema, it only allows for one ipo:purchaseOrder node in the document, since that is the root node. If you have multiple in the incoming file, you no longer have valid XML, both per the schema and because you have no single root node. You have an XML fragment, which must be treated different.
    Just trying to understand the question since I now realize it does not agree with what the schema in your initial example shows.

  • Accessing schema-based XML table

    HI Gentlemen,
    I have a schema-based XMLtype table that I have to query in detail (e.g. via XPath). Documentation states that XML mapping is possible through some Java programming. However, I do not have XML content in a .xml file, it has already been loaded into Oracle DB (that is - non-JAXB)!
    Can anybody recommend a sample code or description of the technology?
    Thanks, regards from
    Miklos HERBOLY

    Your xml document may by represented as an column, you will got the content as other attributes.
    You will not be able to manage the structure of your document natively via the adf layer ... you may marshall/unmarshall the content into a class you build with jaxb or with castor by example (much better interface and classes).
    Note that you will be able to generate a data control from the class that represent the document and use the elements (and/or attributes) of your sturcture in your web pages by drag and drop like for columns in a table.
    Hope this help a little bit

  • IDOC testing: how to upload sample IDOC xml file while outbound IDOCtesting

    Hi experts,
    can any one tell me , how to upload a sample XML idoc xml(data) file while Outbound IDOC testing;
    in WE19 tcode ( insted of manually entering the sample data, i have to import the sample XML/text file into the idoc fields). say IDOC is  MATMAS.
    Thanks in advance;
    Kumar

    Hi Asit Purbey,
    can you clearly explain, how to upload the file and how can i genetare the IDOC no?
    i have seen that function module IDOC_XML_FROM_FILE, in that it is required a port no, what exactly it is, and what type of port is it?
    suppose i am having a XML/TEXT file with IDOC data, how can i upload it into the server and how can convert it into the IDOC and how can i generate the IDOC no for outbound testing?
    Thanks,
    Anil

  • Auotmate the upload of HTS xml file in GTS?

    Hello Every one
    We receive weekly update of new HTS code files from Customs Info to upload in GTS system. Currently we go to Customs Info FTP and then download the HTS xml file and then  Manually upload through transaction /SAPSLL/LLNS_UPL102.
    Can we automate this process through batch job. Kindly suggest.
    Thanks in Advance
    Best Regards
    Kiran Thakkar

    Hi Kiran,
    I think this is possible and I have seen similar solutions in the past.
    I suppose it depends on how much of the process you would like to automate.
    For the whole process to be automated I think you would need some non-ABAP programs and also some input from the Customs Info. website.
    But if we had a user download the file then it would be easier to trigger automatic upload from that point on wards.
    User could always make sure to download the file to a certain folder on the application server.
    You would then need to write a modification or custom program that checks that folder for new files. If it finds a new file then it triggers the background job.
    Or you could set the background job to run every hour, day, week or however you like.
    First step of that job is your custom program to check the application folder
    Second step is to run /SAPSLL/LLNS_UPL102 in background with the new file
    If the first step fails then no upload occurs and the batch job finishes.
    But overall I think you should ask yourself how often you think you will need to upload files from Customs Info?
    Is an automated process really necessary?
    Please keep in mind that any modifications or customs programs will not be supported by SAP.
    If there is a problem with the new process, SAP will ask you to run the process in the standard way. If the standard way works correctly then SAP Support would no longer be able to help.
    Best Regards,
    Eoin

  • XML data upload only from .xml file

    Hi,
    Can anyone let me know is ther any way how I can upload the data from .xml file into Oracle Table.
    Note: I just want to upload the data from xml file; not entire .xml file.
    I have data like as below in test.xml file and I want to upload the data only into TEST_EMP table:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <TABLE_NAME>DEPT</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="2">
    <TABLE_NAME>EMP</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="3">
    <TABLE_NAME>BONUS</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="4">
    <TABLE_NAME>SALGRADE</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="5">
    <TABLE_NAME>BHAVESH_EMP</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    </ROWSET>
    Any help would be highly appreciated!!
    Thanks... Bhavesh

    You may convert the XML into a simple select and insert manually:
    SQL> INSERT INTO test_emp
       SELECT EXTRACTVALUE (t2.COLUMN_VALUE, '/ROW/TABLE_NAME') table_name,
              EXTRACTVALUE (t2.COLUMN_VALUE, '/ROW/TABLESPACE_NAME')
                                                                  tablespace_name
         FROM TABLE
                 (XMLSEQUENCE
                     (EXTRACT
                         (XMLTYPE
                             ('<?xml version = ''1.0''?>
    <ROWSET>
    <ROW num="1">
    <TABLE_NAME>DEPT</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="2">
    <TABLE_NAME>EMP</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="3">
    <TABLE_NAME>BONUS</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="4">
    <TABLE_NAME>SALGRADE</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    <ROW num="5">
    <TABLE_NAME>BHAVESH_EMP</TABLE_NAME>
    <TABLESPACE_NAME>USERS</TABLESPACE_NAME>
    </ROW>
    </ROWSET>
                          '/ROWSET'
                 ) t,
              TABLE (XMLSEQUENCE (EXTRACT (t.COLUMN_VALUE, '/ROWSET/ROW'))) t2

  • Upload Data From XML File !!!!!

    Hi,
    I want to upload data in oracle from XML file. The data will look like the below sample;
    <Transaction>
         <Data>
              <EMP class="R">
                   <Empno IsChanged="Y">7839</Empno>
                   <Ename IsChanged="Y">"TEST"</Ename>
                   <Emp_Hist class="R">
                        <Join_Date IsChanged="Y">2009-09-10</Join_Date>
                   </Emp_Hist>
                        <Emp_Sal class="R">
                        <Basic IsChanged="Y">5000</Basic>
                        </Emp_Sal>
              </EMP>
         </Data>
    </Transaction>
    any suggestion regarding above query? I am using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0. Please guide me for resolving the above issue.
    Thanks.

    So what's wrong with the answers you got at {message:id=3871099}?

  • XSD schema to xml file generation using C#

    Hi fellow developers,
    I need small help with my current scenario.
    I have 2 xsd schemas one is input and other is output.
    Now my requirement is based on those xsd template or structure, i need to write a C# code that takes the 1 xsd template as input in xml format and then do some mapping and then set that values to 2 xsd template in xml format.
    Can you please guide or assist in this regards ??
    It would be helpful if we have the flexibility of configuring the schema properties.

    Hi
    Venky_Ferrari.
    Based on your description, your case related to XMLXSD, SO I will move your thread to
    Data Platform Development > XML, System.Xml, MSXML and XmlLite      
    forum for better support.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Call to createxml with a schema url does not create schema based xml

    Unfortunately I am unable to post the exact creates that I have done, but I am having a problem and none of my DBA's were able to help me.
    Basically what I have done is, I had existing tables in our database that have legacy data in them. Our ultimate goal is to export information in xml format from the database.
    The first thing I did was to create objects in oracle that wrapped the logic of these tables and filled the objects in based on on ID parameter. There are 3 separate levels of objects. One object that has tables of two other objects each of which has tables of objects themselves.
    After the objects were created, I used a call to dbms_xmlschema.generateschema to generate the schema for these objects. After that I changed the schema so that the names of the elements in the schema were names that i wanted to be. I THOUGHT that this would map my oracle object names to new element names.
    After the schema was generated and changed, I used a call to dbms_xmlschema.registerSchema with the following options:
    local=>true, genTypes=>false, force=>false, GENTABLES=>false, genbean=>false
    I tried it with gentables = true, but unfortunately i don't have access to create these tables and the dba's were not allowing me to because they aren't familiar with the xml capabilities and I couldn't explain why it was necessary. I'm not sure that it is.
    Once the schema was registered, i made a call to xmltype.createxml
    with a call to my object contstructor method as the first parameter, and the schema url that was registered in the database as the second parameter.
    Now, here is my problem. The xmltype result that comes back from the query to createxml does not return the element tag names that i had written in the schema. The tag names are the same as the object names which are the same as it is if i didn't use the schema url at all. Does anyone know what I could possibly be doing wrong? Maybe I am misunderstanding the functionality of creating xml with an oracle xml annotated schema. Please help!

    code tags and formatting are done with square brackets :-) Check out the Formatting Help on the message entry page
    What does the URL resolve to when you view source on the JSP page?
    Try it just "/ViewScores" rather than "/servlet/ViewScores"
    Apart from that, it looks fine to me
    Cheers,
    evnafets

  • Schema Based XML View Question

    Hi,
    Is there a way to use the OBJECT ID value in the view's WHERE clause?
    For example:
    create or replace view xml_view of XMLTYPE
    XMLSCHEMA "http://yo.orf/sample.xsd" ELEMENT "el"
    WITH OBJECT ID ( extract('/el/@id').getNumberVal())
    FROM columns( l.id)
    AS
    SELECT XMLElement( "el", ....)
    FROM liner_tbl l
    WHERE l.id = ?? extracted object id value ??
    Can I replace ?? extracted object id value ?? with a some sort of xmldata qualifier?
    Ciao
    Stefano

    Mark,
    Basically we have an XML view that generates undesirable query execution plans for queries on the object id:
    select value(x) from xml_view x
    where existsNode( value(x), '/el[@id="4"') = 1;
    Whereas if I just take the query statement that defines the view alone, and add to it a simple where clause with the value of the object id, the execution plans it generates become optimal.
    select XMLElement( ...)
    from liner_tbl l
    where l.id = 4;
    Ciao
    Stefano

Maybe you are looking for

  • BPS Retraction to CO

    Hello could somebody help us? We have a BPS Model and we need to do retraction to CO in CeBe's . We have readen documentation about retraction but all process consist in to do retraction to CO in CeCO's. We wonder if is it posible to do retraction to

  • WARNING: Could not bind factory to JNDI

    Hi i am using tomcat server5.5 Eclipse 3.2 and adding tomcat plug-in's to my Eclipse i created JNDI on tomcat server i got this type of error plez any one can help me i got this type WARNING WARNING: Could not bind factory to JNDI javax.naming.Naming

  • Oracle 10G Expression Edition Account locked

    Hi all, My Oracle 10G Expression Edition Account locked gets locked, where to raise the request to unlocking my account. as my user name:system Thanks Koty

  • Cannot install adobe reader on MacBook

    I keep trying to install the lastest version of adobe reader and it will not accept my password.  Is this an Apple issue?  I own a MacBook Pro. Thanks, Tara

  • Code in SMARTFORM

    What is the most efficient way to develop a SMARTFORM? to write the code in the smartform or the print program? please help me. I need to know this immediately. Thanks, Archana.