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

Similar Messages

  • 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;

  • 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.

  • Generating table with XML Type column while registering schema

    Hi,
    Is it possible to generate a table with an XML Type column during schema registering. Does the "xdb:defaultTable" always create an XMLType table?
    Thanks.
    Rahul

    "You can create XML schema-based XMLType tables and columns and optionally specify, for example, that they:Conform to pre-registered XML schema ."
    http://download-east.oracle.com/docs/cd/B10501_01/appdev.920/a96620/xdb01int.htm

  • (updating xml value)adding an element in an xml type column

    Hi all,
    i hava a table that contains an xml-Type column (non schema based)
    i have inserted some data in it
    table:(id,xmlcolumn)
    ex:
    insert into t1 values(1,'<Chapters>
    <Chapter>ch1<Chapter>
    <Chapter>ch2<Chapter>
    </Chapters>')
    i need to add a new Chapter: <Chapter>ch3</Chapter>
    for the result of xml instance in the table to be:
    <Chapters>
    <Chapter>ch1<Chapter>
    <Chapter>ch2<Chapter>
    <Chapter>ch3<Chapter>
    </Chapters>
    plz if any one colud help

    SQL> DECLARE
      2      l_xml      XMLTYPE := XMLTYPE('<Chapters>
      3  <Chapter>ch1</Chapter>
      4  <Chapter>ch2</Chapter>
      5  </Chapters>');
      6      l_xsl      XMLTYPE;
      7      l_new_node VARCHAR2(100) := '<Chapter>ch3</Chapter>';
      8  BEGIN
      9      dbms_output.put_line('Before adding node:');
    10      dbms_output.put_line('----------------------------------------------------------------');
    11      dbms_output.put_line(l_xml.getStringVal());
    12      dbms_output.put_line('----------------------------------------------------------------');
    13      l_xsl := XMLTYPE('<?xml version="1.0"?>' ||
    14                       '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"' ||
    15                       ' version="1.0"' || ' result-ns=""' || ' indent="no">' ||
    16                       '<xsl:output method="xml" media-type="text/xml" indent="no"/>' ||
    17                       '<xsl:template match="/">' ||
    18                           '<' ||l_xml.getRootElement() || '>' ||
    19                               ' <xsl:for-each select="/' || l_xml.getRootElement() ||'/Chapter">' ||
    20                                   '<xsl:copy-of select="." />' ||
    21                               '</xsl:for-each>' ||
    22                               l_new_node ||
    23                           '</' || l_xml.getRootElement() || '>' ||
    24                       '</xsl:template>' ||
    25                       '</xsl:stylesheet>');
    26      l_xml := l_xml.Transform(l_xsl);
    27      dbms_output.put_line('After adding node:');
    28      dbms_output.put_line('----------------------------------------------------------------');
    29      dbms_output.put_line(l_xml.getStringVal());
    30      dbms_output.put_line('----------------------------------------------------------------');
    31  END;
    32  /
    Before adding node:
    <Chapters>
    <Chapter>ch1</Chapter>
    <Chapter>ch2</Chapter>
    </Chapters>
    After adding node:
    <Chapters>
      <Chapter>ch1</Chapter>
      <Chapter>ch2</Chapter>
      <Chapter>ch3</Chapter>
    </Chapters>
    PL/SQL procedure successfully completed.
    SQL>

  • Xml type column

    Hi,
    This is my first time ever working with xml type column. I have a xml type column with name,value pairs. This xml type column needs to be indexed. How can I index this column(which index is suitable)? Also can xml type column be used in where clause for the joins with another table columns.
    Thank You
    SK

    XMLTypes in 10.1 are extremely slow and extremely buggy.
    They're maginally better in 10.2 (with the exception of anything added in that release, most notably XQuery), although there are some disasterous bugs in 10.2 in functionality that was actually fine in 10.1 (e.g. memory leaks, scaling nightmares).
    The XML Respository (required for XSD registration and shredding) is very unstable and will cause performance issues and instance outages.
    This is on top of the intrinsic performance and volume inefficiencies involved with XML.
    If you store data in a (column,row) of a SQL table it needs to be atomic with respect to the context of the database. Hiding information inside XML in a column of a table means your data is no longer even in 1st normal form. Surely we can all agree that is a Bad Idea and contrary to any concept of good practise, at this late stage.
    Furthermore querying XML structures is complex, slow and inflexible due to the asymetric nature of hierarchies. And once your information is in it, you're stuck with the incompleteness of XPath and the inefficiency of XQuery. All the indices in the world won't save you.
    More still, it is almost impossible, and very expensive to constrain the data in the XML other than trivial domain and "data type" constraints. The constraints require procedural validation and are not immediate. So you can kiss goodbye to referential integrity and consistency even if you figure out how to implement them.
    Also "abstract clob" XMLType storage requires multiple full document copies for read consistency purposes, so you will cripple your instance and your storage overhead (typically rather kindly benchmarked at 3 times SQL volume) will exponentially run away.
    Just don't do it.

  • Updating xml type column

    Hi,
    I have a xml type column with content as follows
    <?xml version="1.0" encoding="utf-8"?>
    <PartInformation PartNumber="4393">
    <Maintenance />
    <Details>
    <Specs PartNumber="4393">
    <Type Code="K"></Type>
    </Specs>
    </Details>
    </PartInformation>
    <PartInformation PartNumber="4395">
    <Maintenance />
    <Details>
    <Specs PartNumber="4395">
    <Type Code="Z"></Type>
    </Specs>
    </Details>
    </PartInformation>
    I want to update the PartNumber="4393" to PartNumber="5789" for every occurrence .
    What is the easiest way to do it?
    Thanks

    Hi,
    Something like this?
    UPDATE your_table
    SET xmlcol = updatexml(xmlcol,'//*[@PartNumber="4393"]/@PartNumber','5789')
    WHERE ...

  • 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

  • XMLTYPE as CLOB storage "inserting large xml document in xml type column"

    Hi All,
    i have a table containing an xml datatype(non schema based)
    i would like to insert a large xml document in it
    but an exception is thrown-->"string literal too long"
    i tried to use bind variables as a solution"prepared statements as i write in java"
    but it didn't work....as xml document is large
    when i tried to change the column type to CLOB,it worked but without xml validataion,
    although the xml type is mapped to a CLOB in storage, xml type couldn't insert the document
    if anyone have a solution plz tell,i needed it urgently
    thanks,in advance :-)

    thx it was very useful :-)
    but i am not having any success getting the following statement working using a JDBC connection pool rather than a hard coded URL connection
    tempClob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
    it works with:
    "jdbc:oracle:thin:@server:port:dbname"
    Does NOT work with:
    datasource.getConnection()
    if anyone colud help...

  • 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

  • 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>

  • 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"/>

  • 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

  • Schema and XML Type table in Oracle 9.2.0.2.0

    Somebody please helps me!
    I am studying about Oracle XML DB, and I have some problems:
    declare
    result boolean;
    begin
    result := dbms_xdb.createFolder('/doan/' );
    end;
    DELETE FROM resource_view WHERE any_path = '/doan/KHACH_HANG.xsd';
    BEGIN
    result := dbms_xdb.createresource('/doan/KHACH_HANG.xsd','<?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by NGHI (KHTN) -->
    <xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
         <xs:element name="KHACH_HANG">
              <xs:annotation>
                   <xs:documentation>Comment describing your root element</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="MA_KH" type="xs:string"/>
                        <xs:element name="TEN_KH" type="xs:string"/>
                        <xs:element name="DIA_CHI" type="xs:string"/>
                        <xs:element name="DIEN_THOAI" type="xs:string"/>
                        <xs:element name="EMAIL" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>');
    dbms_xmlschema.registerSchema
    'http://localhost:8080/Khach_Hang.xsd',
    xdbURIType('/doan/KHACH_HANG.xsd').getClob(),
    LOCAL => TRUE,
    GENTYPES => TRUE,
    GENTABLES => FALSE,
    OWNER => 'SCOTT');
    DROP TABLE scott.khach_hang;
    CREATE TABLE scott.Khach_Hang OF XMLType
    XMLSchema "http://localhost:8080/Khach_Hang.xsd"
    ELEMENT "KHACH_HANG";
    insert into scott.Khach_Hang values(
    XMLType('<KHACH_HANG>
    <MA_KH>12</MA_KH>
    <TEN_KH>AAAA</TEN_KH>
    <DIA_CHI>135 B Tran Hung Dao</DIA_CHI>
    <DIEN_THOAI>454646</DIEN_THOAI>
    <EMAIL>[email protected]</EMAIL>
    </KHACH_HANG>'));
    END;
    COMMIT;
    When I insert data into table, an error appearance:
    "schema and element does not match"
    Please help me!
    Thanks

    Yes, you can and should be [migrating LONG to LOB in Oracle 9.2|http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96591/adl08lon.htm].
    Justin

Maybe you are looking for

  • I can't create any new reminders on my iPhone 5S with iOS 8.

    Hi. I have a 16 GB iPhone 5S with iOS 8.1.3. The problem I have is that I can't create any new reminders, at all. The problem started with my iPhone 4 (which I had before this phone), and I was using iOS 7 when the problem arose (but it didn't start

  • How to use a webservice in  JSPDyn page

    hai,    I have created one webservices but i donot how to use that webservices in JSPDyn page.   can anyone give solution for this problem Rds Shanthakumar

  • API Oe_Debug_Pub - how to use it?

    Hi all, I'm fairly new to Oracle Financials, but have been a database developer for a while. One of our existing custom packages has the following code: FUNCTION get_subinventory_code(p_database_object_name IN VARCHAR2,                p_attribute_cod

  • XMLDOM package/ Plsql XML parser

    HI, I'm trying to build XML document using plsql parser 1.0.2 using xmldom package. The XML output given is not consistent and the AppendChild Call removed the Root node (from the XML document). This result in incomplete XML document. -------Expected

  • Spark DataGrid - Turn off separators (grid lines) while using Grid itemRenderer?

    I have a spark dataGrid.  We have to use an itemRenderer to format numbers and column colors.  When I apply a Data Grid Skin to remove the separtors (grid lines), the grid lines remain?  It seems you can't have an itemRenderer and a Grid Skin at the