Receiving OCI/ORA-27163 when querying XML data in 11g.

When querying a table with a column stored in XML format, we get this error for large XML values. This works in Oracle 10g but this error happens when the same data is queried in an 11.2.0.3 instance. I have had a support request open with Oracle for about a month and so far it has not made any progress. What we've seen are the following:
1. The xml data itself is good.
2. The good xml data when queried with a wholly 10g client/server environment, works.
3. The same good xml data when inserted into a table in an 11g instance through a stored package run from the 11g instance (server to server) gets the 27163 error.
4. The same xml data when queried in a 10g instance from an 11g client fails with the 27163 error.
5. If we disable the 11g XML parser by setting an internal event (alter session set events='31156 trace name context forever, level 0x400';), then run the same code that was run in item 3 above, it does not get the 27163 error. However, the xml loaded to the 11g instance can then only be queried without getting the 27163 error if we use an older 10g client. An 11g client consistently gets the error.
The server versions are 11.2.0.3 (upgraded from 10.2.0.4). The SQL*Net client versions that we have tested on are 11.2.0.2 and 11.2.0.3 (both produce the 27163 error).
With considerable trial and error, we found that it is some combination of the file size and format that causes the error. Copied below is the smallest sample data of a failing XML that will produce this erro (about 8K). Remove any single character even in an a comment and the file parses successfully – but it’s not the file size alone as the original 800+KB file where we first dicovered this problem will process if the period in the attribute: @value=”${item.id}” is removed.
We are at our wit's end, and with an 11g migration project looming, any ideas anyone can suggest would be very helpful.
Thanks,
Joe
Here is a test case to play around with. Sorry I don't have a way to upload a zip file for this, but you can cut & paste from the post:
1. CREATE TABLE my_xml_test
(record_id NUMBER(4,0),
xml SYS.XMLTYPE,
comments VARCHAR2(200))
ALTER TABLE my_xml_test
ADD CONSTRAINT my_xml_test_pk PRIMARY KEY (record_id)
USING INDEX
2. mkdir SampleData
3. cd into SampleData, copy the XML I will post in the first reply to this message into a new text document called xml_items_removed.xml.
4. cd .. and create a file called 20120112_11g_bad_xml_issue.txt with this in it:
1, .\SampleData\xml_items_removed.xml,"Fails: OriginalXML w/ all instances of <Item> removed (count 600) -- reduces file size to ca. 55KB but still fails (Saved by XMLSpy)"
5. Next create your SQL*Loader control file (call it my_xml_test.ctl):
LOAD DATA
APPEND INTO TABLE my_xml_test
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
record_id,
ext_fname FILLER CHAR(200),
xml LOBFILE(ext_fname) TERMINATED BY EOF,
comments
6. sqlldr <username>/<password>@<database> control=my_xml_test.ctl data=20120112_11g_bad_xml_issue.txt log=20120112_11g_bad_xml_issue.log bad=20120112_11g_bad_xml_issue.bad
7. Once the data is loaded, query my_xml_test table that you created in step 1. You should get the 27163 error:
SELECT a.record_id,
comments,
a.XML,
length(a.XML.GetClobVal()) clob_length
FROM my_xml_test a

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2012 sp1 (http://www.altova.com) by Martin l (National Board of Medical Examiners) -->
<IRData application="Item Review" version="1.3" itempool="2006001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <ViewerTypes>
          <Viewer id="its-viewer">
               <Title>Item Text</Title>
               <Description>Item Text</Description>
               <BaseUrl>https://www.starttest.com/flex/4.3.0.0/InstitutionViewItem.aspx</BaseUrl>
               <Parameters>
                    <Parameter name="pid" value="MSST"/>
                    <Parameter name="iid" value="01123"/>
                    <Parameter name="username" value="SomeUser"/>
                    <Parameter name="item" value="${item.id}"/>
                    <Parameter name="code" value="${CODE}"/>
               </Parameters>
          </Viewer>
     </ViewerTypes>
     <Filters>
          <Filter id="drop-single-filter">
               <AttributeSource>drop</AttributeSource>
               <ControlType>select-1-drop-down-plus-all</ControlType>
          </Filter>
          <Filter id="onoff-single-filter">
               <AttributeSource>onoff</AttributeSource>
               <ControlType>select-1-drop-down-plus-all</ControlType>
          </Filter>
          <Filter id="reviewed-single-filter">
               <AttributeSource>reviewed</AttributeSource>
               <ControlType>select-1-drop-down-plus-all</ControlType>
          </Filter>
          <Filter id="build-multi-filter">
               <AttributeSource>build</AttributeSource>
               <ControlType>select-1-drop-down-plus-all</ControlType>
          </Filter>
          <Filter id="flag-multi-filter">
               <AttributeSource>flag</AttributeSource>
               <ControlType>select-1-drop-down-plus-all</ControlType>
          </Filter>
          <Filter id="u1dt-multi-filter">
               <AttributeSource>U1DT</AttributeSource>
               <ControlType>select-1-drop-down-plus-all</ControlType>
          </Filter>
          <Filter id="fb2-multi-filter">
               <AttributeSource>FB2</AttributeSource>
               <ControlType>select-1-drop-down-plus-all</ControlType>
          </Filter>
          <Filter id="fb1t-multi-filter">
               <AttributeSource>FB1T</AttributeSource>
               <ControlType>select-1-drop-down-plus-all</ControlType>
          </Filter>
          <Filter id="scorecat-multi-filter">
               <AttributeSource>scorecat</AttributeSource>
               <ControlType>select-1-drop-down-plus-all</ControlType>
          </Filter>
          <Filter id="images-multi-filter">
               <AttributeSource>PIXN</AttributeSource>
               <ControlType>select-1-drop-down-plus-all</ControlType>
          </Filter>
          <Filter id="vignettes-multi-filter">
               <AttributeSource>VIG1</AttributeSource>
               <ControlType>select-1-drop-down-plus-all</ControlType>
          </Filter>
     </Filters>
     <DataPanels>
          <Control displayed="true">
               <Filters>
                    <Filter>
                         <Description>Drop</Description>
                         <FilterSource>drop-single-filter</FilterSource>
                    </Filter>
                    <Filter>
                         <Description>Version</Description>
                         <FilterSource>build-multi-filter</FilterSource>
                    </Filter>
                    <Filter>
                         <Description>On/Off Test</Description>
                         <FilterSource>onoff-single-filter</FilterSource>
                    </Filter>
                    <Filter>
                         <Description>Review status</Description>
                         <FilterSource>reviewed-single-filter</FilterSource>
                    </Filter>
                    <Filter>
                         <Description>Flag</Description>
                         <FilterSource>flag-multi-filter</FilterSource>
                    </Filter>
                    <Filter>
                         <Description>Discipline</Description>
                         <FilterSource>fb1t-multi-filter</FilterSource>
                    </Filter>
                    <Filter>
                         <Description>Organ System</Description>
                         <FilterSource>u1dt-multi-filter</FilterSource>
                    </Filter>
                    <Filter>
                         <Description>Step 1 outline</Description>
                         <FilterSource>fb2-multi-filter</FilterSource>
                    </Filter>
                    <Filter>
                         <Description>Images</Description>
                         <FilterSource>images-multi-filter</FilterSource>
                    </Filter>
                    <Filter>
                         <Description>Vignettes</Description>
                         <FilterSource>vignettes-multi-filter</FilterSource>
                    </Filter>
                    <Filter>
                         <Description>Score categories</Description>
                         <FilterSource>scorecat-multi-filter</FilterSource>
                    </Filter>
               </Filters>
          </Control>
          <ItemList displayed="true">
               <Attributes>
                    <Attribute displayed="true">
                         <Description>Item</Description>
                         <AttributeSource>itemref</AttributeSource>
                         <ControlType>text-display</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>On test</Description>
                         <AttributeSource>onoff</AttributeSource>
                         <ControlType>checkbox-select</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Drop</Description>
                         <AttributeSource>drop</AttributeSource>
                         <ControlType>checkbox-select</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Reviewed</Description>
                         <AttributeSource>reviewed</AttributeSource>
                         <ControlType>check-display</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Flag</Description>
                         <AttributeSource>flag</AttributeSource>
                         <ControlType>select-1-drop-down</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Description</Description>
                         <AttributeSource>DESCR</AttributeSource>
                         <ControlType>text-display</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Discipline</Description>
                         <AttributeSource>FB1T</AttributeSource>
                         <ControlType>text-display</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Organ System</Description>
                         <AttributeSource>U1DT</AttributeSource>
                         <ControlType>text-display</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Step 1 outline</Description>
                         <AttributeSource>FB2</AttributeSource>
                         <ControlType>text-display</ControlType>
                    </Attribute>
                    <!-- Attribute displayed="false">                         <Description>Organ System plus</Description>                         <AttributeSource>ORGA</AttributeSource>                         <ControlType>text-display</ControlType>                    </Attribute -->
                    <Attribute displayed="true">
                         <Description>Images</Description>
                         <AttributeSource>PIXN</AttributeSource>
                         <ControlType>text-display</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Vignettes</Description>
                         <AttributeSource>VIG1</AttributeSource>
                         <ControlType>text-display</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Diff</Description>
                         <AttributeSource>pvalue</AttributeSource>
                         <ControlType>text-display</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Discr</Description>
                         <AttributeSource>rbvalue</AttributeSource>
                         <ControlType>text-display</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Answer Key</Description>
                         <AttributeSource>key</AttributeSource>
                         <ControlType>text-display</ControlType>
                    </Attribute>
                    <Attribute displayed="true">
                         <Description>Notes</Description>
                         <AttributeSource>notes</AttributeSource>
                         <ControlType>text-display</ControlType>
                    </Attribute>
               </Attributes>
          </ItemList>
          <CurrentItemInfo>
               <ItemText displayed="true"/>
               <ItemData>
                    <Attribute>
                         <DataSource>scorecat</DataSource>
                         <ControlType>select-each-value</ControlType>
                    </Attribute>
               </ItemData>
          </CurrentItemInfo>
     </DataPanels>
</IRData>
<?BASELINE FB2-A.02.01 on:4 off:3?>
<?BASELINE FB2-A.02.02 on:4 off:4?>
<?BASELINE FB2-A.03.01 on:3 off:1?>
<?BASELINE FB2-A.03.02 on:0 off:1?>
<?BASELINE FB2-A.03.04 on:3 off:2?>
<?BASELINE FB2-A.03.05 on:1 off:0?>
<?BASELINE FB2-A.03.07 on:4 off:2?>
<?BASELINE FB2-A.04.01 on:2 off:5?>
<?BASELINE FB2-A.04.02 on:5 off:3?>
<?BASELINE FB2-A.04.03 on:3 off:1?>
<?BASELINE FB2-A.04.04 on:1 off:1?>
<?BASELINE FB2-A.05.01 on:12 off:14?>
<?BASELINE FB2-A.05.02 on:9 off:1?>
<?BASELINE FB2-A.05.03 on:0 off:6?>
<?BASELINE FB2-A.06.01 on:7 off:9?>
<?BASELINE FB2-A.06.02 on:2 off:6?>
<?BASELINE FB2-A.06.03 on:10 off:5?>
<?BASELINE FB2-A.06.04 on:1 off:1?>
<?BASELINE FB2-A.07 on:23 off:20?>

Similar Messages

  • Optimizing performance when querying XML data

    I have a table in my database containing information about persons. The table has a xmltype column with a lot of data about that person.
    One of the things in there is a telephone number. What I now need to figure out is whether there are any duplicate phone numbers in there.
    The xml basically looks like this (simplefied example):
    <DATAGROUP>
        <PERSON>
            <BUSINESS_ID>123</BUSINESS_ID>
            <INITIALS>M.</INITIALS>
            <NAME>Testperson</NAME>
            <BIRTHDATE>1977-12-12T00:00:00</BIRTHDATE>
            <GENDER>F</GENDER>
            <TELEPHONE>
                <COUNTRYCODE>34</COUNTRYCODE>
                <AREACODE>06</AREACODE>
                <LOCALCODE>4318527235</LOCALCODE>
            </TELEPHONE>
        </PERSON>
    </DATAGROUP>
    As a result I would need the pk_id of the table with the xmltype column in it and a id that's unique for the person (the business_id that's also somewhere in the XML)
    I've conducted this query which will give me all telephone numbers and the number of times they occur.
      SELECT   OD.pk_ID,
               tel.business_id  ,
           COUNT ( * ) OVER (PARTITION BY tel.COUNTRYCODE, tel.AREACODE, tel.LOCALCODE) totalcount
           FROM   xml_data od,
           XMLTABLE ('/DATAGROUP/PERSON' PASSING OD.DATAGROUP
                     COLUMNS "COUNTRYCODE" NUMBER PATH '/PERSON/TELEPHONE/COUNTRYCODE',
                             "AREACODE" NUMBER PATH '/PERSON/TELEPHONE/AREACODE',
                             "LOCALCODE" NUMBER PATH '/PERSON/TELEPHONE/LOCALCODE',
                             "BUSINESS_ID"  NUMBER PATH '/PERSON/BUSINESS_ID'
                 ) tel
           WHERE  tel.LOCALCODE is not null --ignore persons without a tel nr
    Since I am only interested in the telephone number that occur more than once, I used the above query as a subquery:
    WITH q as (
      SELECT   OD.pk_ID,
               tel.business_id  ,
           COUNT ( * ) OVER (PARTITION BY tel.COUNTRYCODE, tel.AREACODE, tel.LOCALCODE) totalcount
           FROM   xml_data od,
           XMLTABLE ('/DATAGROUP/PERSON' PASSING OD.DATAGROUP
                     COLUMNS "COUNTRYCODE" NUMBER PATH '/PERSON/TELEPHONE/COUNTRYCODE',
                             "AREACODE" NUMBER PATH '/PERSON/TELEPHONE/AREACODE',
                             "LOCALCODE" NUMBER PATH '/PERSON/TELEPHONE/LOCALCODE',
                             "BUSINESS_ID"  NUMBER PATH '/PERSON/BUSINESS_ID'
                 ) tel
           WHERE  tel.LOCALCODE is not null) --ignore persons without a tel nr
    SELECT   OD.pk_ID,  tel.business_id
      FROM   q
    WHERE   totalcount > 1
    Now this is working and is giving me the right results, but the performance is dreadful with larger sets of data and will even go into errors like "LPX-00651 VM Stack overflow.".
    What I see is when I do a explain plan for the query is that there are things happening like "COLLECTION ITERATOR PICKLER FETCH PROCEDURE SYS.XQSEQUENCEFROMXMLTYPE" which seems to be something like a equivalent of a full table scan if I google on it.
    Any ideas how I can speed up this query? are there maybe smarter ways to do this?
    One thing to note is that the XMLTYPE data is not indexed in any way. Is there a possibility to do this? and how? I read about it in the oracle docs, but they where not very clear to me.     

    The "COLLECTION ITERATOR PICKLER FETCH" operation means that most likely the XMLType storage is BASICFILE CLOB, therefore greatly limiting the range of optimization techniques that Oracle could apply.
    You can confirm what the current storage is by looking at the table DDL, as Jason asked.
    CLOB storage is deprecated now in favor of SECUREFILE BINARY XML (the default in 11.2.0.2).
    Migrating the column to BINARY XML should give you a first significant improvement in the query.
    If the query is actually a recurring task, then it may further benefit from a structured XML index.
    Here's a small test case :
    create table xml_data nologging as
    select level as pk_id, xmlparse(document '<DATAGROUP>
        <PERSON>
            <BUSINESS_ID>'||to_char(level)||'</BUSINESS_ID>
            <INITIALS>M.</INITIALS>
            <NAME>Testperson</NAME>
            <BIRTHDATE>1977-12-12T00:00:00</BIRTHDATE>
            <GENDER>F</GENDER>
            <TELEPHONE>
                <COUNTRYCODE>34</COUNTRYCODE>
                <AREACODE>06</AREACODE>
                <LOCALCODE>'||to_char(trunc(dbms_random.value(1,10000)))||'</LOCALCODE>
            </TELEPHONE>
        </PERSON>
    </DATAGROUP>' wellformed) as datagroup
    from dual
    connect by level <= 100000 ;
    create index xml_data_sxi on xml_data (datagroup) indextype is xdb.xmlindex
    parameters (q'{
    XMLTABLE xml_data_xtab '/DATAGROUP/PERSON'
    COLUMNS countrycode number path 'TELEPHONE/COUNTRYCODE',
            areacode    number path 'TELEPHONE/AREACODE',
            localcode   number path 'TELEPHONE/LOCALCODE',
            business_id number path 'BUSINESS_ID'
    call dbms_stats.gather_table_stats(user, 'XML_DATA');
    SQL> set autotrace traceonly
    SQL> set timing on
    SQL> select pk_id
      2       , business_id
      3       , totalcount
      4  from (
      5    select t.pk_id
      6         , x.business_id
      7         , count(*) over (partition by x.countrycode, x.areacode, x.localcode) totalcount
      8    from xml_data t
      9       , xmltable(
    10           '/DATAGROUP/PERSON'
    11           passing t.datagroup
    12           columns countrycode number path 'TELEPHONE/COUNTRYCODE'
    13                 , areacode    number path 'TELEPHONE/AREACODE'
    14                 , localcode   number path 'TELEPHONE/LOCALCODE'
    15                 , business_id number path 'BUSINESS_ID'
    16         ) x
    17    where x.localcode is not null
    18  ) v
    19  where v.totalcount > 1 ;
    99998 rows selected.
    Elapsed: 00:00:03.79
    Execution Plan
    Plan hash value: 3200397756
    | Id  | Operation            | Name          | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |               |   100K|  3808K|       |  2068   (1)| 00:00:25 |
    |*  1 |  VIEW                |               |   100K|  3808K|       |  2068   (1)| 00:00:25 |
    |   2 |   WINDOW SORT        |               |   100K|  4101K|  5528K|  2068   (1)| 00:00:25 |
    |*  3 |    HASH JOIN         |               |   100K|  4101K|  2840K|   985   (1)| 00:00:12 |
    |   4 |     TABLE ACCESS FULL| XML_DATA      |   100K|  1660K|       |   533   (1)| 00:00:07 |
    |*  5 |     TABLE ACCESS FULL| XML_DATA_XTAB |   107K|  2616K|       |   123   (1)| 00:00:02 |
    Predicate Information (identified by operation id):
       1 - filter("V"."TOTALCOUNT">1)
       3 - access("T".ROWID="SYS_SXI_0"."RID")
       5 - filter("SYS_SXI_0"."LOCALCODE" IS NOT NULL)
    Statistics
              0  recursive calls
              1  db block gets
           2359  consistent gets
            485  physical reads
            168  redo size
        2352128  bytes sent via SQL*Net to client
          73746  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
          99998  rows processed
    If the above is still not satisfying then you can try structured storage (schema-based).

  • Problem inserting and querying XML data with a recursive XML schema

    Hello,
    I'm facing a problem with querying XML data that is valid against a recursive XML Schema. I have got a table category that stores data as binary XML using Oracle 11g Rel 2 on Windows XP. The XML Schema is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>I registered this schema and created the category table. Then I inserted a new row using the code below:
    insert into category_a values
    (XMlElement("category",
          xmlattributes('categoryAAA' as "id"),
          xmlforest ('ma categ' as "name"),
          (xmlelement("description", (xmlelement("text", 'find doors blest now whiles favours carriage tailor spacious senses defect threat ope willow please exeunt truest assembly <keyword> staring travels <bold> balthasar parts attach </bold> enshelter two <emph> inconsiderate ways preventions </emph> preventions clasps better affections comes perish </keyword> lucretia permit street full meddle yond general nature whipp <emph> lowness </emph> grievous pedro')))    
    The row is successfully inserted as witnessed by the results of row counting. However, I cannot extract data from the table. First, I tried using SqlPlus* which hangs up and quits after a while. I then tried to use SQL Developer, but haven't got any result. Here follow some examples of queries and their results in SQL Developer:
    Query 1
    select * from category
    Result : the whole row is returned
    Query 2
    select xmlquery('$p/category/description' passing object_value as "p" returning content) from category
    Result: "SYS.XMLTYPE"
    now I tried to fully respect the nested structure of description element in order to extract the text portion of <bold> using this query
    Query 3
    select  xmlquery('$p/category/description/text/keyword/bold/text()' passing object_value as "p" returning content) from  category_a
    Result: null
    and also tried to extract the text portion of element <text> using this query
    Query 4
    select  xmlquery('$p/category/description/text/text()' passing object_value as "p" returning content) from  category_a
    Result: "SYS.XMLTYPE".
    On the other hand, I noticed, from the result of query 1, that the opening tags of elements keyword and bold are encoded as the less than operator "&lt;". This explains why query 3 returns NULL. However, query 4 should display the text content of <text>, which is not the case.
    My questions are about
    1. How to properly insert the XML data while preserving the tags (especially the opening tag).
    2. How to display the data (the text portion of the main Element or of the nested elements).
    The problem about question 1 is that it is quite unfeasible to write a unique insert statement because the structure of <description> is recursive. In other words, if the structure of <description> was not recursive, it would be possible to embed the elements using the xmlelement function during the insertion.
    In fact, I need to insert the content of <description> from a source table (called category_a) into a target table (+category_b+) automatically .
    I filled category_a using the Saxloader utility from an flat XML file that I have generated from a benchmark. The content of <description> is different from one row to another but it is always valid with regards to the XML Schema. The data is properly inserted as witnessed by the "select * from category_a" instruction (500 row inserted). Besides, the opening tags of the nested elements under <description> are preserved (no "&lt;"). Then I wrote a PL/SQL procedure in which a cursor extracts the category id and category name into varchar2 variables and description into an XMLtype variable from category_a. When I try to insert the values into a category_b, I get the follwing error:
    LSX-00213: only 0 occurrences of particle "text", minimum is 1which tells that the <text> element is absent (actually it is present in the source table).
    So, my third question is why are not the tags recognized during the insertion?
    Can anyone help please?

    Hello,
    indded, I was using an old version of Sqlplus* (8.0.60.0.0) because I had a previous installation (oracle 10g XE). Instead, I used the Sqlplus* shipped with the 11g2database (version 11.2.0.1.0). All the queries that I wrote work fine and display the data correctly.
    I also used the XMLSERIALIZE function and can now display the description content in SQL Developer.
    Thank you very much.
    To answer your question Marco, I registered the XML Schema using the following code
    declare
      doc varchar2(4000) := '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>';
    begin
      dbms_xmlschema.registerSchema('/xmldb/category_auction.xsd', doc,     LOCAL      => FALSE, 
            GENTYPES   => FALSE,  GENBEAN    => FALSE,   GENTABLES  => FALSE,
             FORCE      => FALSE,
             OPTIONS    => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
             OWNER      => USER);
    end;then, I created the Category table as follows:
    CREATE TABLE category_a of XMLType XMLTYPE store AS BINARY XML
        XMLSCHEMA "xmldb/category_auction.xsd" ELEMENT "category";Now, there still remains a problem of how to insert the "description" content which I serialized as a CLOB data into another table as XML. To this purpose, I wrote a view over the Category_a table as follows:
    CREATE OR REPLACE FORCE VIEW "AUCTION_XWH"."CATEGORY_V" ("CATEGORY_ID", "CNAME", "DESCRIPTION") AS
      select category_v."CATEGORY_ID",category_v."CNAME",
      XMLSerialize(content ( xmlquery('$p/category/description/*' passing object_value as "p" returning content)) as clob) as "DESCRIPTION"
      from  auction.category_a p, 
    xmltable ('$a/category' passing p.Object_Value as "a"
    columns  category_id varchar2(15) path '@id',
              cname varchar2(20) path 'name') category_v;Then, I wrote a procedure to insert data into the Category_xwh table (the source and target tables are slightly different: the common elements are just copied wereas new elements are created in the target table). The code of the procedure is the following:
    create or replace PROCEDURE I_CATEGORY AS
    v_cname VARCHAR2(30);
    v_description clob ;
    v_category_id VARCHAR2(15);
    cursor mycursor is select category_id, cname, description from category_v;
    BEGIN
    open mycursor;
      loop
      /*retrieving the columns*/
      fetch mycursor into v_category_id, v_cname, v_description ;
      exit when mycursor%notfound;
      insert into category_xwh values
      (XMlElement("category",
          xmlattributes(v_category_id as "category_id"),
          xmlelement("Hierarchies", xmlelement("ObjHierarchy", xmlelement ("H_Cat"),
                                                               xmlelement ("Rollsup",
                                                                                  (xmlelement("all_categories",
                                                                                   xmlattributes('allcategories' as "all_category_id")))
        xmlforest (
                  v_cname as "cat_name",
                  v_description as "description")    
    end loop;
      commit;
      close mycursor;
    END I_CATEGORY;When I execute the procedure, I get the following error:
    LSX-00201: contents of "description" should be elements onlyso, I just wonder if this is because v_description is considered as plain text and not as XML text, even if its content is XML. Do I need to use a special function to cast the CLOB as XML?
    Thanks for your help.
    Doulkifli

  • ORA-00604 ORA-00904 When query partitioned table with partitioned indexes

    Got ORA-00604 ORA-00904 When query partitioned table with partitioned indexes in the data warehouse environment.
    Query runs fine when query the partitioned table without partitioned indexes.
    Here is the query.
    SELECT al2.vdc_name, al7.model_series_name, COUNT (DISTINCT (al1.vin)),
    al27.accessory_code
    FROM vlc.veh_vdc_accessorization_fact al1,
    vlc.vdc_dim al2,
    vlc.model_attribute_dim al7,
    vlc.ppo_list_dim al18,
    vlc.ppo_list_indiv_type_dim al23,
    vlc.accy_type_dim al27
    WHERE ( al2.vdc_id = al1.vdc_location_id
    AND al7.model_attribute_id = al1.model_attribute_id
    AND al18.mydppolist_id = al1.ppo_list_id
    AND al23.mydppolist_id = al18.mydppolist_id
    AND al23.mydaccytyp_id = al27.mydaccytyp_id
    AND ( al7.model_series_name IN ('SCION TC', 'SCION XA', 'SCION XB')
    AND al2.vdc_name IN
    ('PORT OF BALTIMORE',
    'PORT OF JACKSONVILLE - LEXUS',
    'PORT OF LONG BEACH',
    'PORT OF NEWARK',
    'PORT OF PORTLAND'
    AND al27.accessory_code IN ('42', '43', '44', '45')
    GROUP BY al2.vdc_name, al7.model_series_name, al27.accessory_code

    I would recommend that you post this at the following OTN forum:
    Database - General
    General Database Discussions
    and perhaps at:
    Oracle Warehouse Builder
    Warehouse Builder
    The Oracle OLAP forum typically does not cover general data warehousing topics.

  • How to query XML data stored in a CLOB column

    I don't know XMLDB, so I have a dumb question about querying XML data which is saved as CLOB in a table.
    I have a table (OLAP_AW_PRC), with a CLOB column - AW_XML_TMPL_VAL
    This column contains this xml data - [click here|http://www.nasar.net/aw.xml]
    Now I want to query the data using the xml tags - like returning the name of AW. This is where I am having trouble, how to query the data from AW_XML_TMPL_VAL clob column.
    The following query generates error:
    ORA-31011: XML parsing failed.
    ORA-19202: Error occurred in XML processing
    LPX-00229: input source is empty
    SELECT
    extractValue(value(x), '/AW/LongName') as "AWNAME"
    from
    OLAP_AW_PRC,
    table(xmlsequence(extract (xmltype(AW_XML_TMPL_VAL), '/AWXML/AWXML.content/Create/ActiveObject/AW'))) x
    where
    extractValue(value(x) , '/AW/Name') = 'OMCR4'
    - Nasar

    Mark,
    Thanks. This is exactly what I was looking for.
    After doing @Name in both places (SELECT and WHERE clause) it worked.
    Now I have one more question.
    There are multiple DIMENSION tags in my xml, and I want to see the NAME attribute values for all of those DIMENSIONs. The following query returns
    ORA-19025: EXTRACTVALUE returns value of only one node.
    Cause: Given XPath points to more than one node.
    Action: Rewrite the query so that exactly one node is returned.
    SELECT
    extractValue(value(x), '/AW/@Name') as "AW",
    extractValue(value(x), '/AW/Dimension/@Name') as "DIMENSIONS"
    from
    OLAP_AW_PRC,
    table(xmlsequence(extract (xmltype(AW_XML_TMPL_VAL), '/AWXML/AWXML.content/Create/ActiveObject/AW'))) x
    where
    extractValue(value(x) , '/AW/@Name') = 'OMCR4'

  • Query xml data from a CLOB datatye

    All,
    I read in an oracle white paper that is is possible to query XML data from CLOB datatype using oracle text index using operators HASPATH() and INPATH(). I am not able to find any example on how to do this. Can someone please post a simple example here.
    Thank You very much!

    SCOTT@10gXE> CREATE TABLE your_table (id NUMBER, xml_data CLOB)
      2  /
    Table created.
    SCOTT@10gXE> INSERT INTO your_table (id, xml_data)
      2  SELECT t.deptno,
      3           DBMS_XMLGEN.GETXML
      4             ('SELECT d.dname,
      5                   CURSOR (SELECT e.ename, e.job
      6                        FROM   emp e
      7                        WHERE  e.deptno = d.deptno) emp_data
      8            FROM   dept d
      9            WHERE  d.deptno = ' || t.deptno)
    10  FROM   dept t
    11  /
    5 rows created.
    SCOTT@10gXE> COMMIT
      2  /
    Commit complete.
    SCOTT@10gXE> begin
      2    ctx_ddl.create_section_group('xmlpathgroup', 'PATH_SECTION_GROUP');
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> CREATE INDEX myindex
      2  ON your_table(xml_data)
      3  INDEXTYPE IS ctxsys.context
      4  PARAMETERS ('datastore ctxsys.default_datastore
      5              filter ctxsys.null_filter
      6              section group xmlpathgroup'
      7            )
      8  /
    Index created.
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'PERSONNEL INPATH (//DNAME)') > 0
      3  /
            ID XML_DATA
            50 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>PERSONNEL</DNAME>
                 <EMP_DATA>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'HASPATH (//DNAME="PERSONNEL")') > 0
      3  /
            ID XML_DATA
            50 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>PERSONNEL</DNAME>
                 <EMP_DATA>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'CLARK INPATH (//ENAME)') > 0
      3  /
            ID XML_DATA
            10 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>ACCOUNTING</DNAME>
                 <EMP_DATA>
                  <EMP_DATA_ROW>
                   <ENAME>CLARK</ENAME>
                   <JOB>MANAGER</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>KING</ENAME>
                   <JOB>PRESIDENT</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>MILLER</ENAME>
                   <JOB>CLERK</JOB>
                  </EMP_DATA_ROW>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'HASPATH (//ENAME="CLARK")') > 0
      3  /
            ID XML_DATA
            10 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>ACCOUNTING</DNAME>
                 <EMP_DATA>
                  <EMP_DATA_ROW>
                   <ENAME>CLARK</ENAME>
                   <JOB>MANAGER</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>KING</ENAME>
                   <JOB>PRESIDENT</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>MILLER</ENAME>
                   <JOB>CLERK</JOB>
                  </EMP_DATA_ROW>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE>

  • Error when  importing xml data

    I am getting the following error when loading xml datafile to my Oracle XE database table. This data I exported from htmldb.oracle.com.
    ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00222: error received from SAX callback function
    please help
    George

    George,
    I expect that this is simply an incompatibility with the date format that was used for XML Import/Export as part of XE Beta. This is a bug that has been fixed for XE production and you will be able to freely export from HTML DB 2.0 and import into XE and vice versa.
    Your NLS settings do not control this. The date format used for XML Export is fixed - a canonical date format is always used.
    If you want to be able to import into XE Beta, your date fields probably look like:
    <HIREDATE>2005-12-03T00:00:00.000</HIREDATE>Just remove the trailing .000 from your date entries.
    <HIREDATE>2005-12-03T00:00:00</HIREDATE>
    Note: This will only be necessary for XE Beta. You should not have to do this for XE Production.
    Joel

  • Free order of tags when deserialising XML-data using Simple Transformatiosn

    Hi everybody,
    I'm consuming a WebService and get something like this XML-data in the response:
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <getSalesResponse>
      <getSalesReturn href="#id0"/>
    </getSalesResponse>
    <multiRef id="id0">
      <customer href="#id1"/>
      <salesOrg href="#id2"/>
      <salesRecord soapenc:arrayType="SalesRecord[2]" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
       <salesRecord href="#id3"/>
       <salesRecord href="#id4"/>
      </salesRecord>
    </multiRef>
    <multiRef id="id1"><customer>124843</customer></multiRef>
    <multiRef id="id2"><salesOrg>0001</salesOrg></multiRef>
    <multiRef id="id3"><material>mat1</material></multiRef>
    <multiRef id="id4"><material>mat2</material></multiRef>
    </soapenv:Body>
    </soapenv:Envelope>
    </xml>
    I've written a Simple Transformation: it fills  my fields i_customer, i_salesorg, i_mat1 and i_mat2 from this XML-Data from the content of the <multiRef>-tags. But only if the order is exactly like this:
    <multiRef><customer><tt:value ref="I_CUSTOMER"/>
      </customer></multiRef>
    <multiRef><salesOrg><tt:value ref="I_SALESORG"/>
      </salesOrg></multiRef>
    <multiRef><material><tt:value ref="I_MATERIAL1"/>
      </material></multiRef>
    <multiRef><material><tt:value ref="I_MATERIAL2"/>
      </material></multiRef>
    However the WebService doesn't guarantee a certain order for the <multiRef>-tags. That means the salesOrg could be contained ahead of the customer.
    In a next step I've tried to use the command '<tt:group>' that allows free order of the first two elements:
    <tt:group>
    <tt:d-cond frq="1">
      <multiRef><customer><tt:value ref="I_CUSTOMER"/>
        </customer></multiRef>
    </tt:d-cond>
    <tt:d-cond frq="1">
      <multiRef><salesOrg><tt:value ref="I_SALESORG"/>
        </salesOrg></multiRef>
    </tt:d-cond>
    </tt:group>
    <multiRef><material><tt:value ref="I_MATERIAL1"/>
      </material></multiRef>
    <multiRef><material><tt:value ref="I_MATERIAL2"/>
      </material></multiRef>
    However the WebService doesn't guarantee any order for the <multiRef>-tags. That means the first material could be contained ahead of the customer.
    How can I insert the lines for my materials into to <tt:group>-command? Actually the WebService could deliever n materials, so I tried this (but that didn't work any more):
    <tt:group>
    <tt:d-cond frq="1">
      <multiRef><customer><tt:value ref="I_CUSTOMER"/>
        </customer></multiRef>
    </tt:d-cond>
    <tt:d-cond frq="1">
      <multiRef><salesOrg><tt:value ref="I_SALESORG"/>
        </salesOrg></multiRef>
    </tt:d-cond>
    <tt:d-cond frq="*">
      <tt:loop name="tab" ref=".IT_MATERIALS">
       <multiRef><material><tt:value ref="$tab.MATERIAL"/>
         </material></multiRef>
      </tt:loop>
    </tt:d-cond>
    Any help would be greatly appreciated. My colleagues have already begun to leave the office because I look more and more frustrated...
    Greeting from Munich,
    markus
    Message was edited by: Markus Jarasch
    Message was edited by: Markus Jarasch

    I have some Interface Mapping questions I was hoping someone could help me with. As you know, my source is an XML File and my target is an OracleDB. I'll start with the "EFFECTIVEDATE" field which was automatically mapped when I added the Source and Target Datastores. As I previously mentioned, this caused an error "Target Column EFFECTIVEDATE: Data may be truncated: the target Column is smaller than the source Column". After looking further into it, would the problem be that the "EFFECTIVEDATE" datatype in the XML is "DATETIME" whereas the "EFFECTIVEDATE" datatype in the database is "TIMESTAMP"? If so, what would be the fix for this? Could I convert it in the Implemenation Mapping like so? -
    CONVERT(MONEY.EFFECTIVEDATE,TIMESTAMP)
    Would using that in the Implementation simply do the trick?
    Anyway, moving onto some of the other TARGET fields...
    -ACTIVITYGUID
    This should be an automatically generated new GUID value. How could I implement this into the Implementation?
    -TRANSACTIONGUID
    I'll need to query some of the other tables in the database in order to get this value. Is this allowed in the Implemenation? Do I have to add said tables to the target somehow? Can I just query the other tables in the Implementation field using normal select statements, etc.? I'm a bit confused on how this would work...
    -TYPECODE
    This needs to be a fixed value of '01'. How do I simply do that in the Implementation?
    The other fields will all be implemented similar to the above so those are the main questions I have for now. Any help would be appreciated.
    Thanks again for your help.

  • Query XML data for blanks

    Hi 
    I am try to see if there are any blanks in a node of a table that has xml data in one of the columns. The query I use is returning zero results. Any suggestions?
    Select COUNT(*)from ENTITY
    Where CONVERT(XML, Ent_root_xml, 0 ).value('(//UD_PQ_FLAG/node())[1]', 'VARCHAR(50)')= ' '

    This is a little tricky. When you don't use /text(), looking for space is the right thing. But when you use /text() you should look for NULL:
    DECLARE @x TABLE (id int NOT NULL, x xml NOT NULL)
    INSERT @x (id, x)
       VALUES (1, '<ROOT><Node>This node is intentionally not left blank.</Node></ROOT>'),
              (2, '<ROOT><Node></Node></ROOT>')
    SELECT id
    FROM   @x
    CROSS  APPLY x.nodes('/ROOT') AS T(x)
    WHERE  T.x.value('(Node/text())[1]', 'varchar(23)') IS NULL
    SELECT id
    FROM   @x
    CROSS  APPLY x.nodes('/ROOT') AS T(x)
    WHERE  T.x.value('Node[1]', 'varchar(23)') = ' '
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Placing a parameter for a report in header when no XML data returned

    Good Afternoon ~
    I have a request from a user that requires the need to place a reports parameters in the header of the report even though  the report may return no data.  Example of this would be a missing time card report. 
    I have only seen the use of this when there is data returned.  If the report returns no data there is no XML.  
    I have no idea how I would accomplish this.  Any suggestions I can get on this is much appreciated.  How would I capture the parameter used?
    Thank you much!
    G

    Apparently I am not notified of these updates.    Sorry this took me a bit to get to you. 
    The report data is using an Oracle Report to generate the XML.  All other formatting is done in BI  Publisher.

  • Error when querying OLAP data with BI answers

    Have been doing all the Lessons in "Using Oracle OLAP With Oracle BI Enterprise Edition 10g Release 3". Got till lesson 3 where I'm supposed to query the data with Answers but If I add any of the facts to the report, I get the following error:
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17003] Oracle gateway error: Unsupported data type 101. (HY000)
    SQL Issued: SELECT Customer."Ship To" saw_0, Measures.COST saw_1 FROM Global ORDER BY saw_0
    So I was wondering if anyone knows what the catch could be.
    Thanks in advance!

    Yes. Me too. I have the same issue and I don't find any information about it. Could anyone help ?

  • Ora-00942 when querying object privs

    Hi, I have a OEM 9.2 accessing an Oracle 9.2 instance. When querying object privs I get error 942. All else works OK. I have 07_dictionary_accesibility=true and the OEM user has DBA and select any dictionary privs. oms.nohup does not show anything unusual neither dbsnmp.log . Any ideas?

    there will still be some sys objects that may throw this

  • ORA-31020 when using XML with external DTD or entities

    I'd like to parse XML documents against a modular DTD that references other DTDs. This works fine with Oracle 9i. But after upgrading to 11g, the parsing of XML-instances fails and DBMS_XMLPARSER.parseClob produces ORA-31020.
    The same error occurs even if I simply try to store XML with a reference to an external DTD as xmltype:
    SQL> select xmltype('<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE ewl-artikel SYSTEM "http://www.foo.com/example.dtd"><test>123</test>') from dual;
    ERROR:
    ORA-31020: Der Vorgang ist nicht zulässig, Ursache: For security reasons, ftp
    and http access over XDB repository is not allowed on server side
    ORA-06512: in "SYS.XMLTYPE", Zeile 310
    ORA-06512: in Zeile 1
    How can I use external DTDs on remote servers in order to parse XML in an 11g database??? Any ideas for a workaround? Thanks in advance!

    This is my PL/SQL validation procedure:
    procedure validatexml (v_id in number default 0) is
    PARSER DBMS_XMLPARSER.parser;
    DTD_SOURCE clob;
    DTD_DOCUMENT xmldom.DOMDocumentType;
    XML_INSTANCE xmltype;
    BEGIN
    -- load DTD from XDB repository
    SELECT httpuritype('http://example.foo.de/app1/DTD1.dtd').getclob() into DTD_SOURCE from dual;
    -- load XML instance
    select co_xml into XML_INSTANCE from tb_xmltab where co_id=v_id;
    -- parse XML instance
    PARSER := DBMS_XMLPARSER.newParser;
    xmlparser.setValidationMode( PARSER , false);
    xmlparser.parseDTDClob( PARSER , DTD_SOURCE , 'myfirstnode' );
    DTD_DOCUMENT := xmlparser.getDoctype( PARSER );
    xmlparser.setValidationMode( PARSER , true );
    xmlparser.setDoctype( PARSER , DTD_DOCUMENT );
    DBMS_XMLPARSER.parseClob( PARSER , v_xml );
    DBMS_XMLPARSER.freeParser(PARSER);
    htp.print('<P>XML instance succesfully validated!<P>');
    end validatexml;

  • MailboxExportRequest ContentFilter is "Received -ne $null" when querying by date.

    I am trying to export a mailbox to a PST. All email that was received before
    yesterday is what I am trying to export. 
    $y = ((get-date).addDays(-1)).ToShortDateString()$exportRequest = New-MailboxExportRequest -ContentFilter {(Received -lt $y)} -mailbox userID -FilePath\\SHARED\folder\userID.pst
    Something is not right here. I end up exporting the entire mailbox.
    When I run a:
    Get-MailboxExportRequest | Get-MailboxExportRequestStatistics | select ContentFilter
    It says that my content filter is:
    Received -ne $null
    I am sure something is wrong with my syntax here, but I can't seem to get it.

    Hi Johnny,
    Please checkout this MS-Library to find the correct syntax for exporting mailbox to PST:
    http://technet.microsoft.com/en-us/library/ff607299(v=exchg.150).aspx
    Another good resource you can explore at here(http://www.exchangemailboxtopst.org/) which will make your task more easier while need to export mailboxes to PST.

  • Report Query - XML data source empty

    Hello!
    I built a report query, using the wizard, under Shared Components and when I test the query using bind variables I get the correct data, but as I click Apply Changes and get to the screen where it gives me the option to Download the data source for the report layout, the file is empty. I've repeated the steps multiple times, each time getting correct data when testing the query, yet nothing in my xml file.
    Any ideas on why this is happening?
    Thank you.

    Hello! Thank you for responding!
    I actually am having problems on the "Report Queries" section under "Shared Components"...my query doesn't return any data when I try to download/open the xml file. Once I'm able to get this fixed, I'll be able to open my report on the page that has the branch.

Maybe you are looking for

  • New iPod + account not showing up on a computer that was previously used with a DIFFERENT iPod and account

    I'm very new to all things Apple, but not a computer/tech newbie...it's just that all my experience and knowledge has been aquired with Windows and Android. I received an iPod Touch 5th gen as a Xmas gift, and I'm (mostly) enjoying it...but I've hit

  • Access Time Capsule over the internet

    Hey guys! I have a problem. I cannot access my Time Capsule over the internet. I have a Time Capsule 2013 which connects to the internet using a PPPoE connection and which provides wireless connection to other peripherals in my house. The TC is runni

  • Apple internet apps crashing..please help

    Hello all... it seems that every Apple application I have that is internet related is crashing. It began with Safari. Yesterday it just quit on me, out of the blue. Since then, on relaunch as soon as I attempt to access any site... it quits. iChat no

  • Flash site issue

    I have a problem with a flash site I inherited. When I click the back button in Internet Explorer it takes me all the the way back to the Flash intro and not the last page I was in. This appears to be a site issue problem it is not IE related. Any he

  • How do we programmatically "enable" the Page to have

    Some body known how do we programmatically "enable" the Page to have Item level security. - analogous to checking the box in the Page edit mode for "Enable item level security" J.