Select start_with - connect in XML document (it looks like a bug in 11.2 g)

Hello

I really have no idea of what is the difference between these two cases and why one does not return anything. I have an xml document:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><dirObjects>
    <DIR_OBJECT>
        <ABSOLUTE_PATH>/home/pavel/Templates</ABSOLUTE_PATH>
        <OBJ_ID>0</OBJ_ID>
        <TREE_LEVEL>0</TREE_LEVEL>
        <OBJ_NAME>Templates</OBJ_NAME>
        <PARENT_ID>-1</PARENT_ID>
        <OBJ_TYPE>D</OBJ_TYPE>
    </DIR_OBJECT>
    <DIR_OBJECT>
        <ABSOLUTE_PATH>/home/pavel/Templates/test.txt</ABSOLUTE_PATH>
        <OBJ_ID>1</OBJ_ID>
        <TREE_LEVEL>1</TREE_LEVEL>
        <OBJ_NAME>test.txt</OBJ_NAME>
        <PARENT_ID>0</PARENT_ID>
        <OBJ_TYPE>F</OBJ_TYPE>
    </DIR_OBJECT>
</dirObjects>

and if I run the select statement of the following

with
xml_result as (
select xtab.ABSOLUTE_PATH  ABSOLUTE_PATH
     , xtab.OBJ_TYPE
     , to_number(xtab.PARENT_ID) PARENT_ID
     , xtab.OBJ_NAME
     , to_number(xtab.TREE_LEVEL) TREE_LEVEL
     , to_number(xtab.OBJ_ID) OBJ_ID
  from apex_collections c,
          XMLTable('/dirObjects/DIR_OBJECT' passing xmltype001
            COLUMNS ABSOLUTE_PATH PATH 'ABSOLUTE_PATH'
                  , OBJ_TYPE PATH 'OBJ_TYPE'
                  , PARENT_ID PATH 'PARENT_ID'
                  , OBJ_NAME PATH 'OBJ_NAME'
                  , TREE_LEVEL PATH 'TREE_LEVEL'
                  , OBJ_ID PATH 'OBJ_ID'
          ) xtab
where c.collection_name = 'P9_DOREST_RESULTS'
)
select ABSOLUTE_PATH,OBJ_TYPE,PARENT_ID,OBJ_NAME,TREE_LEVEL,OBJ_ID
from
xml_result
--start with PARENT_ID =-1 connect by prior OBJ_ID=PARENT_ID

He returned these 2 files

Result:

ABSOLUTE_PATH Obj_type PARENT_ID OBJ_NAME TREE_LEVEL OBJ_ID
/ Home/Pavel/templatesD-1Templates00
/Home/Pavel/templates/test.txtF0test.txt11

but when I Uncomment the last row, it returns nothing.

When I insert exactly the same values in a normal table that looks like this:

Name of Type Null

------------- ---- --------------

ABSOLUTE_PATH VARCHAR2 (4000)

OBJ_TYPE VARCHAR2 (4000)

PARENT_ID NUMBER

OBJ_NAME VARCHAR2 (4000)

NUMBER OF TREE_LEVEL

OBJ_ID NUMBER

After the statement select returns the same result as the previous

SELECT ABSOLUTE_PATH ,OBJ_TYPE ,PARENT_ID ,OBJ_NAME ,TREE_LEVEL ,OBJ_ID
FROM dir_objects
--START WITH parent_id    =-1 CONNECT BY prior obj_id =parent_id

Result:

ABSOLUTE_PATH Obj_type PARENT_ID OBJ_NAME TREE_LEVEL OBJ_ID
/ Home/Pavel/templatesD-1Templates00
/Home/Pavel/templates/test.txtF0test.txt11

but when I Uncomment the last row (START WITH parent_id = - 1 CONNECT BY prior obj_id = parent_id), it always returns 2 records

Result:

ABSOLUTE_PATH Obj_type PARENT_ID OBJ_NAME TREE_LEVEL OBJ_ID
/ Home/Pavel/templatesD-1Templates00
/Home/Pavel/templates/test.txtF0test.txt11

Any idea what is the difference and why the first select statement returns no that anything would be much appreciated.

Best regards

Pavel

The solution to this nasty bug and arresting the optimizer doing a rewrite buggy was to use a scalar subquery via dual and expose the XML in this way.

Select ABSOLUTE_PATH, OBJ_TYPE,

PARENT_ID, OBJ_NAME,

TREE_LEVEL, OBJ_ID

from (select xtab. ABSOLUTE_PATH ABSOLUTE_PATH,

xtab. OBJ_TYPE,

TO_NUMBER (xtab. PARENT_ID PARENT_ID),

xtab. OBJ_NAME,

TO_NUMBER (xtab. TREE_LEVEL TREE_LEVEL),

TO_NUMBER (xtab. OBJ_ID OBJ_ID)

from (select (select xmltype001

of apex_collections c

where c.collection_name = 'P9_DOREST_RESULTS') as xmltype001

the double) c,.

XMLTable)

' / dirObjects/DIR_OBJECT.

passage xmltype001

COLUMNS

ABSOLUTE_PATH PATH "ABSOLUTE_PATH."

OBJ_TYPE PATH "OBJ_TYPE."

PARENT_ID PATH "PARENT_ID"

OBJ_NAME PATH "OBJ_NAME,"

TREE_LEVEL PATH "TREE_LEVEL."

OBJ_ID PATH "OBJ_ID.

) xtab

)

Start by PARENT_ID = - 1

Connect prior OBJ_ID = PARENT_ID

Tags: Database

Similar Questions

  • Problem does not occur when it is not connected USB so that it looks like some sort of communication problem. The L355 worked perfectly.

    Hello

    I recently installed an Epson L555 instead of my Epson L355, which worked well with my software windows 7 and my BACK program based. However, whenever the L555 turned the printer just keeps ejecting the hopper pages until it is empty. On the menu screen, it says "printing", but there is nothing in the print queue and I didn't send anything to be printed. Sometimes it reads "Fax set auto answer. By pressing the Stop/Reset button stops the ejection pages and "Cancel" is displayed on the screen. This continues for about 2-3 minutes, then the pages start ejected again. Problem does not occur when it is not connected USB so that it looks like some sort of communication problem. The L355 worked perfectly.

    Hello

    Thanks for posting your query in the Microsoft community.

    I understand that print jobs are getting cancelled and I will be happy to answer your query. There could be several reasons for this cause and to diagnose the problem, initially, I ask you to refer to the suggestions in the article below and check.

    Solve printer problems

    Hope this information is useful. Please feel free to answer in the case where you are facing in the future other problems with Windows.

  • How my XML file should look like to shoot ListItem.selected

    • ListItem.active - indicates whether the list item is active. An element is active if the user has a finger on it.
    • ListItem.selected - indicates whether the list item is selected. An item is selected if the user has typed the element and it appears selected on the screen.
    • ListItem.data - allows access to the data of the list item in the data model. This is equivalent to the ListItemData property that is used above.

    If im using meanings which would my look of xml file to do this work. Below the example xml. What would look like my xml if I wanted all the foregoing to be selected after a finger on her, real by selecting and sending it.

    
    

    Look at the stampcollector of the sample.

    (There is also cascadescookbook and weatherguesser)

    The concept that you need is the following: the xml file contains the data.  How is the list view display and interact with data. These are separate things.  The xml file should not have any dependence on the interaction between the program with data.

    See: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller

    The XML in your case is the model.

    the XmlDataModel plays a role which is largely the controller in the MVC jargon.

    So check if something is selectable is made by putting in place your ListView.

    There is a lot of documentation easy to read under https://developer.blackberry.com/cascades/ with some great worked examples that should make clear how everything fits together.

    Stuart

  • Problem set (it looks like a bug)

    It's about ORACLE 10.2.0.4.0

    I'm working on a SQL query to return the calendar dates.
    When I run the present:
    SELECT workdate
    FROM
    (
      SELECT TO_DATE(TO_CHAR(m.month) || '/' || TO_CHAR(d.day) || '/' || TO_CHAR(y.year), 'MM/DD/YYYY') AS workdate
      FROM
      (
        (
          SELECT 2011 AS year FROM dual
        ) y
        CROSS JOIN
        (
                    SELECT  1 AS month FROM dual
          UNION ALL SELECT  2 AS month FROM dual
          UNION ALL SELECT  3 AS month FROM dual
          UNION ALL SELECT  4 AS month FROM dual
          UNION ALL SELECT  5 AS month FROM dual
          UNION ALL SELECT  6 AS month FROM dual
          UNION ALL SELECT  7 AS month FROM dual
          UNION ALL SELECT  8 AS month FROM dual
          UNION ALL SELECT  9 AS month FROM dual
          UNION ALL SELECT 10 AS month FROM dual
          UNION ALL SELECT 11 AS month FROM dual
          UNION ALL SELECT 12 AS month FROM dual
        ) m
      )
      JOIN
      (
                  SELECT  1 AS day FROM dual
        UNION ALL SELECT  2 AS day FROM dual
        UNION ALL SELECT  3 AS day FROM dual
        UNION ALL SELECT  4 AS day FROM dual
        UNION ALL SELECT  5 AS day FROM dual
        UNION ALL SELECT  6 AS day FROM dual
        UNION ALL SELECT  7 AS day FROM dual
        UNION ALL SELECT  8 AS day FROM dual
        UNION ALL SELECT  9 AS day FROM dual
        UNION ALL SELECT 10 AS day FROM dual
        UNION ALL SELECT 11 AS day FROM dual
        UNION ALL SELECT 12 AS day FROM dual
        UNION ALL SELECT 13 AS day FROM dual
        UNION ALL SELECT 14 AS day FROM dual
        UNION ALL SELECT 15 AS day FROM dual
        UNION ALL SELECT 16 AS day FROM dual
        UNION ALL SELECT 17 AS day FROM dual
        UNION ALL SELECT 18 AS day FROM dual
        UNION ALL SELECT 19 AS day FROM dual
        UNION ALL SELECT 20 AS day FROM dual
        UNION ALL SELECT 21 AS day FROM dual
        UNION ALL SELECT 22 AS day FROM dual
        UNION ALL SELECT 23 AS day FROM dual
        UNION ALL SELECT 24 AS day FROM dual
        UNION ALL SELECT 25 AS day FROM dual
        UNION ALL SELECT 26 AS day FROM dual
        UNION ALL SELECT 27 AS day FROM dual
        UNION ALL SELECT 28 AS day FROM dual
        UNION ALL SELECT 29 AS day FROM dual
        UNION ALL SELECT 30 AS day FROM dual
        UNION ALL SELECT 31 AS day FROM dual
      ) d
      ON (
           m.month IN (1, 3, 5, 7, 8, 10, 12)
           OR (
                m.month != 2
                AND d.day <= 30
              )
           OR d.day <= 28
           OR (
                d.day = 29
                AND MOD(y.year, 4) = 0
              )
         )
    )
    ORDER BY workdate;
    I get all the dates back from 01/01/2011 to 31/12/2011.

    However, when I replace the ORDER BY with:
    WHERE workdate = TO_DATE('01/01/2011', 'MM/DD/YYYY');
    I get an error "Invalid Date for the month specified" (ORA-01839).
    (The same error regardless the date that I use in the WHERE clause).

    If one of the dates in the application were invalid, then select it would have cast the same mistake, wouldn't it?

    -Don

    If you want to generate VALID dates between a specific date of beginning and end, I recommend the following:

    var startdate VARCHAR2(25);
    var enddate VARCHAR2(25);
    
    WITH date_generator AS
    (
            SELECT  TO_DATE(:startdate,'MM/DD/YYYY') + (ROWNUM-1) AS DT
            FROM    DUAL
            CONNECT BY ROWNUM <= TO_DATE(:enddate,'MM/DD/YYYY') - TO_DATE(:startdate,'MM/DD/YYYY') + 1
    )
    SELECT  * FROM DATE_GENERATOR
    
  • Problem with the entire event looks like a bug

    Hello

    I got a requirement like this, there are two text fields Textfield1 and Textfield2 to say, and Textfield1 is full it should automatically go to textfield2 and fill the characters typed on the keyboard. I had this implemented using comprehensive event. If Textfield1 is full change focus to Textfield2.

    Now, I met a very strange question, i.e., the last character I enter Textfield1 won't Textfield2. His only full because is triggered to the key of the last character.

    I tried other alternatives did not work.

    Guys, now I do not understand is that true. Someone had the same problem.

    Thank you for all that you do.

    Yes, I used this script

    xfa.host.setFocus ("TextField2");   in my complete case. However, I could solve the problem by using newText and limiting the length to 50.

    Now I got a different question, that is, it does not work if I enter all uppercase the TextField1.

    Reason for the number of characters is different for upper and lower case. Don't know how to handle this.

    In addition, I expect to complete event can be a solution in this case, however if I use full event and you change the focus to new textfield the last key shot strays.

    Any help on this would be much appreciated...

  • Looks like a bug to me

    Here's a screenshot of what I see after the application starts:

    http://Yadi.SK/d/P3igKXx2MvYNT

    I tried to reinstall the application - no effect.

    > The window just empty

    Clouds WHITE http://forums.adobe.com/message/5484303 screen

    - and step by step http://forums.adobe.com/thread/1440508?tstart=0

    - and http://helpx.adobe.com/creative-cloud/kb/blank-white-screen-ccp.html

  • Change the content of the xml document as data selected with SQLX functions

    Hi all
    I have seen several examples of database xml documents using SQLX functions but they seem to be simple queries, which we reproduce the same forest of xml in all elements. What I'm trying to do is to create something like the following:


    < billing xmls = "http://blurb.com" >
    < header >
    < timestamp > 2008-12-11 13:28:46 < / timestamp >
    < source > ORCL < / source >
    < / header >
    < transaction and billing-answers >
    < invoice-transaction-response >
    < invoice-transaction-id > 36866320 < / billing-transaction-id >
    ORDER of < invoice-transaction-type > < / billing-transaction-type >
    <-group-id of transaction > 092220082100 < / transaction-group-id >
    < ok >
    < charged to date > 2008-09-22T 10: 20:43 - 05:00 < / beak-date >
    < /OK. >
    < / billing-transaction-response >
    < invoice-transaction-response >
    < invoice-transaction-id > 37617490 < / billing-transaction-id >
    ORDER of < invoice-transaction-type > < / billing-transaction-type >
    <-group-id of transaction > 112020082100 < / transaction-group-id >
    < error >
    reasons <>
    < reason >
    < text > impossible to derive information of customer SHIP_TO < / text >
    < / reason >
    < / reasons >
    < / error >
    < / billing-transaction-response >
    < / billing-transaction-answers >
    < / billing >


    I can see how to generate the individual components of the xml document, but I don't know how to put this together in a single select statement:


    SQL > SELECT XMLElement ("billing", XMLAttributes (http://blurb.com LIKE "xmls")
    2, XMLElement ("header"
    3, XMLElement ("timestamp", TO_CHAR (SYSDATE, ' YYYY-MM-DD HH24:MI:SS'))))
    4, XMLElement ("source", "ORCL'"))).extract('/*') xml
    5 FROM DUAL;

    XML
    ----------------------------------------------------------------------------------------
    < billing xmls = "http://blurb.com" >
    < header >
    < timestamp > 2008-12-11 13:28:46 < / timestamp >
    < source > ORCL < / source >
    < / header >
    < / billing >


    SQL > SELECT XMLElement ("billing transaction-answers"
    2, XMLAgg (XMLElement ("billing-transaction-reply"
    3, XMLElement ("billing transaction id", billing_transaction_id)
    4, XMLElement ("billing-transaction-type", billing_transaction_type)
    5, XMLElement ("transaction-group-id", transaction_group_id)
    6, XMLElement ("ok"
    7, XMLElement ("beak-date", billed_date))).extract('/*') xml
    8 FROM table_a
    9 status WHERE! = 'E';

    XML
    ----------------------------------------------------------------------------------------------------
    < transaction and billing-answers >
    < invoice-transaction-response >
    < invoice-transaction-id > 36866320 < / billing-transaction-id >
    ORDER of < invoice-transaction-type > < / billing-transaction-type >
    <-group-id of transaction > 092220082100 < / transaction-group-id >
    < ok >
    < charged to date > 2008-09-22T 10: 20:43 - 05:00 < / beak-date >
    < /OK. >
    < / billing-transaction-response >
    < / billing-transaction-answers >



    MDACFS@CORPD23 > SELECT XMLElement ("billing transaction-answers"
    2, XMLAgg (XMLElement ("billing-transaction-reply"
    3, XMLElement ("billing transaction id", billing_transaction_id)
    4, XMLElement ("billing-transaction-type", billing_transaction_type)
    5, XMLElement ("transaction-group-id", transaction_group_id)
    6, XMLElement ("error"
    7, XMLElement ("patterns"
    8, XMLElement ("reason"
    9, XMLElement ("text", error_message))).extract('/*') xml
    10 FROM table_a
    * 11 situation WHERE = 'E '; *

    XML
    -------------------------------------------------------------------------------------
    < transaction and billing-answers >
    < invoice-transaction-response >
    < invoice-transaction-id > 37617490 < / billing-transaction-id >
    ORDER of < invoice-transaction-type > < / billing-transaction-type >
    <-group-id of transaction > 112020082100 < / transaction-group-id >
    < error >
    reasons <>
    < reason >
    < text > impossible to derive information of customer SHIP_TO < / text >
    < / reason >
    < / reasons >
    < / error >
    < / billing-transaction-response >
    < / billing-transaction-answers >

    This is my first attempt to generate xml from the database if it is not a correct approach then please notify. Any help much appreciated.

    See you soon,.
    Paul.

    Given you already wrote each song as a separate statement which refers to what you want, you already have the concept and just need to merge the three queries SQL in one alone. Here is an example of the fusion of your first two SQL set statements.

    SELECT XMLElement("billing", XMLAttributes('http://blurb.com' AS "xmls")
            ,XMLElement("header"
              ,XMLElement("timestamp", TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS'))
              ,XMLElement("source", 'ORCL')
             ),
             (SELECT XMLElement("billing-transaction-replies"
                      ,XMLAgg(XMLElement("billing-transaction-reply"
                       ,XMLElement("billing-transaction-id", rownum))))
               FROM dual
               CONNECT BY level <= 5
             )) rslt
    FROM DUAL;
    
    returns
    
    
         
    2008-12-12 09:21:39 ORCL
    1 2 3 4 5
  • Impossible to analyze the xml.aspx contained in the main.js.Iam get the following error"could not obtain XML document, and the connection has failed: status 500

    Impossible to analyze the xml.aspx contained in the main.js.Iam get the following error"could not obtain XML document, and the connection has failed: status 500

    My main.js resembles

    xmlDataSource var = {}
     
    URL: 'dcds. - symbianxml.aspx", etc. (sample).
     
    init: function() {}
    URL, successful reminder, the reminder of failure
    This.Connect (this.) (URL, this.responseHandler, this.failureHandler);
    },
     
    /**
    * Analyzes the XML document in an array of JS objects
    @param xmlDoc XML Document
    * @returns {table} array of objects of the device
    */
    parseResponse: {function (xmlDoc)}
        
    var chElements = xmlDoc.getElementsByTagName ("channel");
       
    channels of var = [];
      
    Console.log (chElements.Length);
      
    for (var i = 0; i)< chelements.length;="">
        
    var channel = {};
       
    for (var j = 0; j)< chelements[i].childnodes.length;="">
        
    var node = Sublst.ChildNodes(1).ChildNodes(0) chElements [i] [j];
                
    If (node.nodeType! = 1) {//not an element node}
    continue;
    }
           
    Channel [node. TagName] = node.textContent;
    }
       
    Channels.push (Channel);
    }
    Console.log (Channels.Length);
    return the strings;
    },
     
    /**
    Manages the response and displays the data from device web app
    @param xmlDoc
    */
    responseHandler: {function (xmlDoc)}
      
    var channel = this.parseResponse (xmlDoc);
    var markup = "";
       
    for (i = 0; i< channels.length;="">
       
    markup += this.generateHTMLMarkup (i, channels [i]);
    }
    document.getElementById("accordian").innerHTML = mark-up;
    },
     
    /**
    Generates HTML tags to insert in to the DOM Web App.
    * @index i, index of the device
    @param device, device object
    */
    /*
    generateHTMLMarkup: function (i, channel) {}
      
    var str ="";
    "Str += '.


    ' onclick =-"mwl.setGroupTarget ('#accordian ',' #items_" + i + "', 'ui-show ',' ui - hide');" + ".
    "mwl.setGroupTarget ('#accordian ',' item_title_ #" + i + "', 'ui-open', 'ui-farm'); Returns false; \ » > » ;
    "" Str += "" + channel ['name'] + ' ";
    "Str += '.
    ";
    "Str += '.
    ";
    "Str += '.
    "+" id: "+ channel ['id'] +" ' "
    ";
    "Str += '.
    "+" type: "+ channel ['type'] +" ' "
    ";
    "Str += '.
    "+" language: "+ channel ['language'] +" ' "
    ";
    "Str += '.
    «+ "bandwidth:" + "fast" channel + "»»
    ";
    "Str += '.
    "+" cellnapid: "+ channel ["cellnapid"] +". "
    ";
    "Str += '.
    «+ ' link: '+'start the video »»
    ";
    "Str += '.
    ";
    return str;
    },*/
    generateHTMLMarkup: function (i, channel) {}
       
    var str ="";
    "Str += '.
    ";
    str +=  "" +
    "" + channel ['name'] + ""+""
    ";
    "Str += '.
    «+ ' link: '+'start the video »»
    ";
         
    return str;

    },
     
    failureHandler: {function (reason)}
    document.getElementById("accordian").innerHTML = "could not get XML document.
    '+ reason;
    },
     
    /**
    Retrieves a resource XML in the given URL using XMLHttpRequest.
    @param url URL of the XML resource to retrieve
    @param called successCb, in the XML resourece is recovered successfully. Retrieved XML document is passed as an argument.
    @param failCb called, if something goes wrong. Reasons, in text format, is passed as an argument.
    */

    Connect: {function (url, successCb, failCb)
      
    var XMLHTTP = new XMLHttpRequest();
      
    XMLHTTP. Open ("GET", url, true);

    xmlhttp.setRequestHeader("Accept","text/xml,application/xml");
    xmlhttp.setRequestHeader ("Cache-Control", "non-cache");
    xmlhttp.setRequestHeader ("Pragma", "non-cache" "");
      
    var that = this;
    XMLHTTP.onreadystatechange = function() {}
       
    If (xmlhttp.readyState == 4) {}
        
    If (XMLHTTP. Status == 200) {}
         
    {if (!) XMLHTTP.responseXML)}
    try {}
    If server has not responded with good an XML MIME type.
    var domParser = new DOMParser();
    var xmlDoc = domParser.parseFromString(xmlhttp.responseText,"text/xml");
           
    successCb.call (that, xmlDoc);
           
    } catch (e) {}
    failCb.call (, "answer was not in an XML format.");
    }
              
    } else {}
    successCb.call (that, xmlhttp.responseXML);
    }
    } else {}
    failCb.call (this, "connection failed: status"+ xmlhttp.status ");
    }
    }
    };
    XMLHTTP. Send();
    }
    };

    Please see the content in main.js is fully analyzed.

    Forward for the solution to my request all members of the community...

  • "Error loading XML Document from saw.dll./answers/saw.selections.xml?fmapId=RRxCfQ. "The answer was: ' when you access analytic dashboards

    During these months, we were faced with an error "" error when loading XML Document saw.dll./answers/saw.selections.xml?fmapId=RRxCfQ. "The answer was: ' when you access analytical dashboards OBIEE.

    It is a global problem, and users cannot access any dashboard in OBIEE analytics.

    We used weblogicPlugin 1.1 to configure the reverse proxy for our 64-bit using IIS 7.5 weblogic server. WebLogic Server Version: 10.3.6.0. We see the error "resolveRequest: application ' / analytics/saw.dll/answers/saw.selections.xml' has not been sent." Found OR '?', or ';' in URI "in the IIS Proxy log.

    This question is regardless of the browser and get to each broser we tested. Users should click on the error message loading XML Web page pop for about 20 times to see the dashboard.


    No idea how to solve this problem?

    By Oracle Support suggestion, I installed Oracle HTTP server (OHS) and the problem is solved. For now, the problem is solved but SITEMINDER SSO and Siebel IFRAMES should be tested with OSH being the web server now.

  • No data when querying XML document which does not have all the elements that are populated

    Hi people

    Following the previous post http://bit.ly/beyCdc forum, I met a new show that I'm looking to solve today.

    General information:

    The xml document, I try to shred them may exist in 2 forms; b limited form and (b) complex form, which
    to comply with the same xmlschema.

    The structure of the two forms of the document is:

    b limited version

    (1) under the parent node (of BASANTA) is a child node - RTDRFileHeader
    (2) also under the parent node is a node of complex "ConnectionList. This can consist of thousands of child nodes 'connection '.
    (3) below a given node of "Connection" are child nodes that are of interest, they are:
          
          Connection/HPMN
          Connection/VPM
          Connection/FileItemList/FileItem/FileType/InitTAP/TAPSeqNo
          Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TAPTxCutoffTmstp
          Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TAPAvailTmstp
          Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TAPCurrency
          Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TotalNetCharge
          Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TotalTax
    (b) extended version

    The structure of the Extended version is identical to the above limited version but there are elements of additional group under the /chargeInfo. element
    It's TrafficBreakdownList and AdditionalChargeInfo. In addition, the TrafficBreakdownList has child nodes that contain elements of the group.
    For example.
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/CallEventType
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/CallEventType/CallEventInfo/NumberOfEvents
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/CallEventType/CallEventInfo/TotNetCharge
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/CallEventType/CallEventInfo/TotTaxValue
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/InvPeriod
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalNetChargeSDR
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalTaxSDR
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/VPMNLocCurr
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalNetChargeVLCSR
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalNetChargeVLCCD
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalTaxVLCCD
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalTaxVLCCD
    What I'm trying to achieve, if possible, is to have a SQL statement that can interrogate the two versions of the xml document. Currently
    the following SQL statement works properly against the extended version XML document, but when used against the limited version he returns no rows.

    I guess what I'm after is like a LEFT JOIN XML :-) If the node is not present, returns NULL for this element.

    b limited Version of XML
    <RTDR>
      <RTDRFileHeader>
        <Prefix>MRTDR</Prefix>
        <Sender>EDSCH</Sender>
        <Recipient>NXTMP</Recipient>
        <PMN>UKRAS</PMN>
        <ReportSeqNo>5</ReportSeqNo>
        <TADIGGenSchemaVersion>2.2</TADIGGenSchemaVersion>
        <RTDRSchemaVersion>1.1</RTDRSchemaVersion>
        <CreationTmstp>2009-09-04T04:04:00.000000+02:00</CreationTmstp>
      </RTDRFileHeader>
    <ConnectionList>
     <Connection>
          <VPMN>UKRAS</VPMN>
          <HPMN>LIEK9</HPMN>
          <FileItemList>
            <FileItem>
              <FileID>CDUKRASLIEK901274-00005-m</FileID>
              <ExchTmstp>2009-08-24T12:07:22.000000+02:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>1274</TAPSeqNo>
                  <NotifFileInd>true</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2009-08-24T12:52:10.000000+03:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2009-08-24T11:52:10.000000+02:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDUKRASLIEK901280-00005-m</FileID>
              <ExchTmstp>2009-08-30T12:14:39.000000+02:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>1280</TAPSeqNo>
                  <NotifFileInd>true</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2009-08-30T12:52:34.000000+03:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2009-08-30T11:52:34.000000+02:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
          </FileItemList>
        </Connection>
      <Connection>
          <VPMN>UKRZZ</VPMN>
          <HPMN>LIEZZ</HPMN>
          <FileItemList>
            <FileItem>
              <FileID>CDUKRZZLIEZZ01274-00005-m</FileID>
              <ExchTmstp>2009-08-24T12:07:22.000000+02:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>1274</TAPSeqNo>
                  <NotifFileInd>true</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2009-08-24T12:52:10.000000+03:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2009-08-24T11:52:10.000000+02:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDUKRZZLIEZZ01280-00005-m</FileID>
              <ExchTmstp>2009-08-30T12:14:39.000000+02:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>1280</TAPSeqNo>
                  <NotifFileInd>true</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2009-08-30T12:52:34.000000+03:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2009-08-30T11:52:34.000000+02:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
          </FileItemList>
        </Connection>
     </ConnectionList>
     </RTDR> '
    (b) extended version of XML
    <RTDR xmlns:tadig-gen="https://infocentre.gsm.org/TADIG-GEN" xmlns="https://infocentre.gsm.org/TADIG-RTDR">
      <RTDRFileHeader>
        <Prefix>DRTDR</Prefix>
        <Sender>EDSCH</Sender>
        <Recipient>NXTMP</Recipient>
        <PMN>AAAAA</PMN>
        <ReportSeqNo>1</ReportSeqNo>
        <TADIGGenSchemaVersion>2.2</TADIGGenSchemaVersion>
        <RTDRSchemaVersion>1.1</RTDRSchemaVersion>
        <CreationTmstp>2010-03-17T12:32:37.000000+01:00</CreationTmstp>
      </RTDRFileHeader>
      <ConnectionList>
        <Connection>
          <VPMN>AAAAA</VPMN>
          <HPMN>GRCCO</HPMN>
          <FileItemList>
            <FileItem>
              <FileID>CDAAAAAGRCCO04164-00001-d</FileID>
              <ExchTmstp>2010-03-16T00:30:27.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>4164</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T00:15:25.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T00:15:25.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>48.546</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>7</NumberOfEvents>
                          <TotNetCharge>11.16</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>2</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>GPRS Calls</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>26</NumberOfEvents>
                          <TotNetCharge>37.35</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>1</NumberOfEvents>
                          <TotNetCharge>.036</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>3</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>48.546</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>54.687</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>54.216</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDAAAAAGRCCO04165-00001-d</FileID>
              <ExchTmstp>2010-03-16T09:27:15.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>4165</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T09:15:20.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T09:15:20.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>7.114</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>5</NumberOfEvents>
                          <TotNetCharge>4.985</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>1</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>GPRS Calls</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>10</NumberOfEvents>
                          <TotNetCharge>2.057</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>2</NumberOfEvents>
                          <TotNetCharge>.072</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>6</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>7.114</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>8.014</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>7.959</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDAAAAAGRCCO04166-00001-d</FileID>
              <ExchTmstp>2010-03-16T14:28:43.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>4166</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T14:15:23.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T14:15:23.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>1.638</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>2</NumberOfEvents>
                          <TotNetCharge>1.458</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>7</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>5</NumberOfEvents>
                          <TotNetCharge>.18</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>15</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>1.638</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>1.845</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>1.832</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
          </FileItemList>
        </Connection>
        <Connection>
          <VPMN>AAAAA</VPMN>
          <HPMN>GRCSH</HPMN>
          <FileItemList>
            <FileItem>
              <FileID>CDAAAAAGRCSH03283-00001-d</FileID>
              <ExchTmstp>2010-03-16T00:30:29.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>3283</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T00:15:25.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T00:15:25.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>1</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>0</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>0</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>0</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDAAAAAGRCSH03284-00001-d</FileID>
              <ExchTmstp>2010-03-16T09:27:16.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>3284</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T09:15:20.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T09:15:20.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>.072</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>2</NumberOfEvents>
                          <TotNetCharge>.072</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>2</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>.072</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>.081</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>.081</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDAAAAAGRCSH03285-00001-d</FileID>
              <ExchTmstp>2010-03-16T14:28:45.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>3285</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T14:15:24.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T14:15:24.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>1</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>0</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>0</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>0</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
          </FileItemList>
        </Connection>
      </ConnectionList>
    </RTDR>’
    It's the query I want to be able to run against the two XML documents. As mentioned, this works very well against the complex XML but no result against the simple XML.
    SELECT
             rtd.rtdr_document_id
            ,rtd.filename
            ,EXTRACTVALUE(rtd.rtdr , '/RTDR/RTDRFileHeader/PMN' )                                      client_pmn
            ,connXML."VPMN"                                                                            vpmn
            ,connXML."HPMN"                                                                            hpmn
            ,fileXML."TAPSeqNo"                                                                        tap_seq_no
            ,chrgXML."TAPTxCutoffTmstp"                                                                tap_tx_cut_off_tmstp
            ,chrgXML."TAPAvailTmstp"                                                                   tap_avail_tmstp
            ,chrgXML."TAPCurrency"                                                                     tap_currency
            ,chrgXML."TotalNetCharge"                                                                  total_net_charge
            ,chrgXML."TotalTax"                                                                        total_tax
            ,traffXML."CallEventType"                                                                  call_event_type     
            ,callEvtXML."NumberOfEvents"                                                               number_of_events
            ,callEvtXML."TotNetCharge"                                                                 call_event_ttl_net_charge
            ,callEvtXML."TotTaxValue"                                                                  call_event_ttl_tax_value
    FROM     t   rtd
            ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                      '/RTDR/ConnectionList/Connection'
                      PASSING  rtd.myXML
                      COLUMNS
                      "VPMN"       VARCHAR2(5)    PATH '/Connection/VPMN'
                     ,"HPMN"       VARCHAR2(5)    PATH '/Connection/HPMN'
                     ,"FileXML"    XMLTYPE        PATH '/Connection/FileItemList/FileItem/FileType/InitTAP'
                     )  connXML
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                      '/InitTAP'
                      PASSING  connXML."FileXML"
                      COLUMNS
                      "TAPSeqNo"       VARCHAR2(50)   PATH '/InitTAP/TAPSeqNo'
                     ,"ChargeInfoXML"  XMLTYPE        PATH '/InitTAP/ChargeInfo'
                    )  fileXML
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                     '/ChargeInfo'
                      PASSING  fileXML."ChargeInfoXML"
                      COLUMNS
                      "TAPTxCutoffTmstp"          VARCHAR2(30)     PATH '/ChargeInfo/TAPTxCutoffTmstp'
                     ,"TAPAvailTmstp"             VARCHAR2(30)     PATH '/ChargeInfo/TAPAvailTmstp'
                     ,"TAPCurrency"               VARCHAR2(30)     PATH '/ChargeInfo/TAPCurrency'
                     ,"TotalNetCharge"            NUMBER(22,5)     PATH '/ChargeInfo/TotalNetCharge'
                     ,"TotalTax"                  NUMBER(22,5)     PATH '/ChargeInfo/TotalTax'
                     ,"TrafficBreakdownListXML"   XMLTYPE          PATH 'TrafficBreakdownList/TrafficBreakdownItem'
                    )  chrgXML
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                     '/TrafficBreakdownItem'
                      PASSING  chrgXML."TrafficBreakdownListXML"
                      COLUMNS
                      "CallEventType"             VARCHAR2(20)     PATH '/TrafficBreakdownItem/CallEventType'
                     ,"CallEventInfoXML"          XMLTYPE          PATH '/TrafficBreakdownItem/CallEventInfo'
                    )  traffXML
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                     '/CallEventInfo'
                      PASSING  traffXML."CallEventInfoXML" 
                      COLUMNS
                      "NumberOfEvents"            NUMBER           PATH '/CallEventInfo/NumberOfEvents'
                     ,"TotNetCharge"              NUMBER           PATH '/CallEventInfo/TotNetCharge'
                     ,"TotTaxValue"               NUMBER           PATH '/CallEventInfo/TotTaxValue'
                    )   callEvtXML
    Thank you very much

    Kind regards

    Simon Gadd

    Hi Simon,.

    I guess what I'm after looks like a LEFT JOIN XML

    Exactly.

    Try to add a (+) after the last two XMLTABLEs operator:

    ...
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                     '/TrafficBreakdownItem'
                      PASSING  chrgXML."TrafficBreakdownListXML"
                      COLUMNS
                      "CallEventType"             VARCHAR2(20)     PATH '/TrafficBreakdownItem/CallEventType'
                     ,"CallEventInfoXML"          XMLTYPE          PATH '/TrafficBreakdownItem/CallEventInfo'
                    ) (+)  traffXML
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                     '/CallEventInfo'
                      PASSING  traffXML."CallEventInfoXML"
                      COLUMNS
                      "NumberOfEvents"            NUMBER           PATH '/CallEventInfo/NumberOfEvents'
                     ,"TotNetCharge"              NUMBER           PATH '/CallEventInfo/TotNetCharge'
                     ,"TotTaxValue"               NUMBER           PATH '/CallEventInfo/TotTaxValue'
                    ) (+)  callEvtXML
    

    HTH.

    PS: the declaration of namespaces does not appear in the 'limited' version, perhaps you simply forgotten in your sample? Could you confirm?

  • Schema validation fails on the transformed XML document

    OK, this is weird.

    I get XML files that are supposed to conform to a given XSD. There are dozens of different parties who send these files. To be more precise, I refer to the Ontario Energy Board (OEB) PIPE Documents.

    I found that at least one sender sends invalid files. I can't that fixes to the source, so I'm working around that.

    for example
    <?xml version="1.0" encoding="UTF-8"?>
    <PIPEDocument  xmlns="http://www.oeb.gov.on.ca" 
                              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                              xsi:schemaLocation="http://www.oeb.gov.on.ca/ PIPEDocument.xsd" 
                              Version="4.0" 
                              DocumentReferenceNumber="xxx" CreationDate="20110825100008000ES">
    <MarketParticipantDirectory>
    <Sender>
    ...
    Oracle is not like this:
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00344: namespace values "http://www.oeb.gov.on.ca" and "http://www.oeb.gov.on.ca/" differ
    OK, so to work around this problem, before schema validation, I apply an XSLT transformation to clean the top-level element:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.oeb.gov.on.ca">
    <xsl:output method="xml" indent="no"/>
    
    <xsl:template match="/">
        <xsl:copy>
          <xsl:apply-templates/>
        </xsl:copy>
    </xsl:template>
    
    <xsl:template match="*">
        <xsl:if test="local-name() = name()">
                <xsl:element name="{local-name()}">
                  <xsl:apply-templates select="@*|node()"/>
                </xsl:element>
        </xsl:if>
    </xsl:template>
    
    <xsl:template match="@*">
        <xsl:if test="local-name() = name()">
                <xsl:attribute name="{local-name()}">
                  <xsl:value-of select="."/>
                </xsl:attribute>
        </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    Nice: the fact that it is intended for:
    <?xml version="1.0" encoding="UTF-8"?>
    <PIPEDocument xmlns="http://www.oeb.gov.on.ca" 
                             Version="4.0" 
                             DocumentReferenceNumber="50520110825080908VA0001.EBT" 
                             CreationDate="20110825100008000ES">
    <MarketParticipantDirectory>
    <Sender>
    ...
    If I now the schema validate the above transformed XML, then it validates OK.

    Large? No, if I try to turn on the fly (i.e. without first transformation and followed by reading in the transformed data from the file), I get a strange error:
    declare
     v_xml xmltype := xmltype(bfilename('ERS_FILE_LOAD_308', 'DecryptedFile-30873604.xml'), 0).transform(XDBURIType('/ERS_TEST01/PIPE/XSLT/V1.0/pre_validate_XSLT.xsl').getXML());
     v_xsd_name varchar2(255) := 'PIPE/Power/V4.0/PIPEDocument.xsd'; 
    begin
    if v_xml.isSchemaValid(v_xsd_name) = 1 then 
           dbms_Output.put_line('valid');
        else
           dbms_Output.put_line('invalid');
           
           --in order to get specific error info for a non-schema message need to convert the XML to schema based
           
           v_xml := v_xml.createSchemaBasedXML(v_xsd_name);
          
           v_xml.schemaValidate();               
           
        end if;  
    end;
    /
    ORA-31043: Element '' not globally defined in schema ''
    Exsqueeze me? What element in the schema?

    The transformation itself works very well. Specifically, if I run the following:
    select xmltype(bfilename('ERS_FILE_LOAD_308', 'DecryptedFile-30873604.xml'), 0).transform(XDBURIType('/ERS_TEST01/PIPE/XSLT/V1.0/pre_validate_XSLT.xsl').getXML()).getclobval() from dual;
    ... I get the desired result. Of course, if I save the result file and validate the fact that it works:
    declare
     v_xml xmltype := xmltype(bfilename('ERS_FILE_LOAD_308', 'DecryptedFile-30873604_manually_saved.xml'), 0);
     v_xsd_name varchar2(255) := 'PIPE/Power/V4.0/PIPEDocument.xsd'; 
    begin
    if v_xml.isSchemaValid(v_xsd_name) = 1 then 
           dbms_Output.put_line('valid');
        else
           dbms_Output.put_line('invalid');
           
           --in order to get specific error info for a non-schema message need to convert the XML to schema based
           
           v_xml := v_xml.createSchemaBasedXML(v_xsd_name);
          
           v_xml.schemaValidate();               
           
        end if;  
    end;
    /
    I would like to join example XML file, but it contains customer data so I can't do that. I would fix the XSD but it is the nest of a rat of 50 XSD with includes and a 300 script online registration scheme, so I can't do that.

    What I'm missing here?

    Looks like an Oracle bug for me at this isSchemaValid binds to a beginning of the XML instance and not to the instance transformed.

    thoughts?

    (using database Oracle 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production under linux)

    Published by: Pollocks01 on October 18, 2011 16:11

    Hello

    Looks like an Oracle bug for me at this isSchemaValid binds to a beginning of the XML instance and not to the instance transformed.

    That wouldn't be surprising. There are "few" bugs on the XSL transformation.
    Here's a recently posted: {: identifier of the thread = 2245703}

    The solution was to serialize the output and analyze again.
    So, what you describe on 'reading of a works file' makes me think it's the same kind of problem.

    You can also view the contents of the variable just after that:

    v_xml := v_xml.createSchemaBasedXML(v_xsd_name);
    

    ?

  • Funny problem with generating xml looks like table.

    Hello
    I have the following problem:

    1.I has table:
    CREATE TABLE DESCRIPTION
    (
    NUMBER OF DESC_ID
    SK VARCHAR2 (500 BYTE),
    OF VARCHAR2 (500 BYTE).
    EN VARCHAR2 (500 BYTE)
    )

    2.I need to create an xml looks like:

    < "NODE1" >
    < "NODE2" >
    data column < /de > < >
    column < www.tourocloudbackup.com > < en > data
    given < sk > column < /sk > sk
    < / "NODE2" >
    < / "NODE1 >"

    where "PAR1" and "PAR2" is CASE-SENSITIVE SETTING of RESPECT.

    3. I create for that to be the next function:


    CREATE or REPLACE FUNCTION F_CREATE_XML_DESC (inDescId, NUMBER of)
    inNode1 VARCHAR2,
    inNode2 VARCHAR2)
    RETURN OF XMLTYPE
    IS
    tmpVar NUMBER;
    /******************************************************************************


    ******************************************************************************/
    vXml XMLTYPE.

    CTX DBMS_XMLGEN.ctxHandle;
    vColumnList VARCHAR2 (1000);
    vXmlStr VARCHAR2 (1000);

    BEGIN


    If (inDescId is not null) then
    SELECT SUBSTR (list) of LENGTH (list) - 1, 1,
    IN vColumnList
    FROM (SELECT (LISTAGG (COLUMN_NAME |))) ',')
    TO WITHIN THE GROUP (ORDER OF COLUMN_NAME))
    As a list
    Of user_tab_columns
    WHERE table_name = 'DESCRIPTION' AND COLUMN_NAME <>'DESC_ID');


    CTX: =.
    DBMS_XMLGEN.
    NewContext)
    "select".
    || vColumnList
    || "description d where d.desc_id ='".
    || inDescId);

    on the other
    -yesterday to return null if DESC_ID is null
    Returns a null value.

    SELECT SUBSTR (list) of LENGTH (list) - 1, 1,
    IN vColumnList
    FROM (SELECT (LISTAGG ("'"' |))) "ACE" | COLUMN_NAME | ' ,')
    TO WITHIN THE GROUP (ORDER OF COLUMN_NAME))
    As a list
    Of user_tab_columns
    WHERE table_name = 'DESCRIPTION' AND COLUMN_NAME <>'DESC_ID');

    CTX: =.
    DBMS_XMLGEN.
    NewContext)
    "select".
    || vColumnList
    || "of the double");


    end if;

    -DBMS_XMLGEN.setRowSetTag (ctx, inNode1);
    DBMS_XMLGEN.setRowTag (ctx, 'NŒUD');
    DBMS_XMLGEN. SETNULLHANDLING (ctx, 2);

    -I DON'T KNOW WHY THIS DOESN'T WORK!
    -DBMS_XMLGEN.useLowerCaseTagNames ();


    vXmlStr: low = (DBMS_XMLGEN.getxml (ctx));

    DBMS_XMLGEN. CLOSECONTEXT (ctx);

    If (inNode1 is not null and)
    inNode2 is not null) then

    Select xmlelement (EVALNAME (inNode1),
    XmlElement (EVALNAME (inNode2),
    Extract (XmlType (vXMLStr), '//node/*')))
    in vXml
    Double;
    end if;

    If (inNode1 is null and)
    inNode2 is not null) then

    Select xmlelement (EVALNAME (inNode2),
    Extract (XmlType (vXMLStr), '//node/*'))
    in vXml
    Double;
    end if;


    If (inNode1 is not null and)
    inNode2 is null) then

    Select xmlelement (EVALNAME (inNode1),
    Extract (XmlType (vXMLStr), '//node/*'))
    in vXml
    Double;
    end if;



    VXML BACK;
    END F_CREATE_XML_DESC;
    /


    4 Requriments:
    If I add the new column to the table Description the XML should include this new column.
    Problem is a RESPECT for the CASE, the table tags MUST be LOWER case, and of course without column DESC_ID, BUT the two NODE1 and NODE2 SHOULD be case-sensitive.

    5. function whihch I cooked up in my opinion is not fast enough. IS THERE a SOLUTION to make this better? Help, please.

    6 DB: Oracle 11 g R2.

    Edited by: kozand 2011-06-26 05:06

    Hello

    -I DON'T KNOW WHY THIS DOESN'T WORK!
    -DBMS_XMLGEN.useLowerCaseTagNames ();

    I don't see in the package specification.

    I'm not a big fan of this but you can try the following solutions:

    SQL> DECLARE
      2
      3   inNode1      varchar2(30) := 'NODE1';
      4   inNode2      varchar2(30) := 'NODE2';
      5   inDescId     number := 1;
      6
      7   colList      varchar2(4000);
      8
      9   xml_data     xmltype;
     10   doc          clob;
     11
     12  BEGIN
     13
     14   SELECT listagg(column_name || ' as "' || lower(column_name) || '"', ',') within group (order by column_name)
     15   INTO colList
     16   FROM user_tab_columns
     17   WHERE table_name = 'DESCRIPTION'
     18   AND column_name != 'DESC_ID';
     19
     20   EXECUTE IMMEDIATE 'SELECT XMLForest(' || colList || ') FROM description WHERE desc_id = :1'
     21   INTO xml_data
     22   USING inDescId;
     23
     24   SELECT nvl2( inNode1
     25              , XMLElement(evalname(inNode1), xml_data)
     26              , xml_data )
     27   INTO xml_data
     28   FROM (
     29     SELECT nvl2( inNode2
     30                , XMLElement(evalname(inNode2), xml_data)
     31                , xml_data ) as xml_data
     32     FROM dual
     33   );
     34
     35   dbms_output.put_line(xml_data.getclobval());
     36
     37  END;
     38  /
    
    data from column dedata from column endata from column sk
    
    PL/SQL procedure successfully completed
     
    

    Or a single XQuery:

    SQL> show user
    User is "dev"
    
    SQL>
    SQL> SELECT XMLSerialize(document
      2    XMLQuery(
      3      'let $data :=
      4         for $i in fn:collection("oradb:/DEV/DESCRIPTION")/ROW
      5         where $i/DESC_ID = $id
      6         return
      7           for $j in $i/child::*
      8           let $node-name := name($j)
      9           where $node-name != "DESC_ID"
     10           return element {fn:lower-case($node-name)} {fn:data($j)}
     11       let $node2 := if ($inNode2) then element {$inNode2} {$data} else ($data)
     12       return if ($inNode1) then element {$inNode1} {$node2} else ($node2)'
     13      passing cast(1 as number) as "id"
     14            , 'NODE1' as "inNode1"
     15            , 'NODE2' as "inNode2"
     16      returning content
     17    )
     18    as clob indent
     19  )
     20  FROM dual
     21  ;
    
    XMLSERIALIZE(DOCUMENTXMLQUERY(
    --------------------------------------------------------------------------------
    
      
        data from column sk
        data from column de
        data from column en
      
    
     
    
  • Merge the XML document in a table

    Hello
    I want to merge some of the values of an xml document in a table "Project_Table".

    CREATE TABLE Project_Table
    (
    TASK_ID NUMBER (15),
    TASK_NAME VARCHAR2 (100 BYTE),
    START_DATE DATE,
    )

    I am using the following procedure, that I adapted from another post. It inserts null values, I think because I'm not showing the nodes correctly.

    DECLARE
    BFILE v_bfile: = BFILENAME ("'DTEMP","test.xml");
    v_clob CLOB.
    BEGIN
    -Create directory DTEMP as "C:\TEMP";
    -grant read the < schema > DTEMP directory;

    DBMS_LOB.CREATETEMPORARY (v_clob, TRUE);
    DBMS_LOB. OPEN (v_bfile, DBMS_LOB.lob_readonly);
    DBMS_LOB. LoadFromFile (v_clob, v_bfile, DBMS_LOB.lobmaxsize);
    Dbms_output.put_line (v_clob);
    MERGE IN project_table t
    USING (SELECT TO_NUMBER (EXTRACTVALUE (VALUE (x), ' / task ')) task_id,)
    To_date (EXTRACTVALUE (value (x), "/ start"), 'DD-MM-YYYY') start_date,
    EXTRACTVALUE (value (x), "/ name") TaskName
    (SELECT XMLTYPE (v_clob) XML
    THE DOUBLE).
    TABLE (XMLSEQUENCE (EXTRACT (xml, ' / project'))) x) r
    WE (t.task_id = r.task_id)
    WHEN MATCHED THEN
    UPDATE
    SET t.start_date = r.start_date, t.task_name = r.task_name
    WHEN NOT MATCHED THEN
    INSERT (task_id, start_date, taskname)
    VALUES (r.task_id, r.start_date, r.task_name);
    COMMIT;
    END;

    This is the document of test.xml.

    <? XML version = "1.0" encoding = "UTF-8"? >
    -name of the project 'ProjectName' company 'Company' webLink = = = "" view-date = '2009-12-14"see-index '0' = gantt-Divider-location = '300' resource-divider-card ="300"version ="2.0">"
    < description / >
    < zoom-view state = "default: 8" / >
    -<!
    ->
    -< calendars >
    -day-types >
    < day-type id = '0' / >
    < day-type id = "1" / >
    -< Calendar id = "1" name = "default" >
    < Sun weeks default = '0' LUN '0' = TEU = '0' kills = '0' game = '0' Fri '0' = Saturday = '0' / >
    < overloaded-day-types / >
    < days / >
    < / calendar >
    < / day-types >
    < / calendars >
    -task color = "#8cb6ce" >
    -< taskproperties >
    < taskproperty id = "tpd0" name = 'type' type = 'default' valuetype = "icon" / >
    < taskproperty id = "TDP1" name = 'priority' type = 'default' valuetype = "icon" / >
    < taskproperty id = "tpd2" name = 'info' type = 'default' valuetype = "icon" / >
    < taskproperty id = "tpd3" name = "name" type = 'default' valuetype = "text" / >
    < taskproperty id = "tpd4" name = "begindate" type = 'default' valuetype = "date" / >
    < taskproperty id = "tpd5" name = "enddate" type = 'default' valuetype = "date" / >
    < taskproperty id = "tpd6" name = "Duration" type = 'default' valuetype = "int" / >
    < taskproperty id = "tpd7" name = "completion" type = 'default' valuetype = "int" / >
    < taskproperty id = "tpd8" name = "Coordinator" type = 'default' valuetype = "text" / >
    < taskproperty id = "tpd9" name = "predecessorsr" type = "default" valuetype = "text" / >
    < / taskproperties >
    < job id = '0' name = 'TaskA"color =" #0099cc "form = meeting"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"="false"start ="2010-01-28"duration ="1"complete ="0"priority ="1"expand ="true"/ >
    < task id = "1" name = "TaskB" color = "#ff0000" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-01-28" duration = "1" complete = "100" priority = "1" expand = "true" / >
    < job id = "2" name = 'Day' color = "#ff9933" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-02-01" duration = "19" complete = "0" priority = "1" expand = "true" / >
    < job id = "3" name = "TaskD" color = "#ff0000" form = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" meeting = "false" start = "2010-02-01" duration = "32" full = "100" priority = "1" expand = "true" / >
    < job id = "4" name = "TaskE" color = "#66ff99" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-02-01" duration = "67" complete = "0" priority = "1" expand = "true" / >
    < job id = "5" name = "TaskF" color = "#66ff99" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-02-01" duration = "46" complete = "10" priority = "1" expand = "true" / >
    < job id = "6" name = "TaskG" color = "#00cccc" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-03-15" duration = "30" complete = "0" priority = "1" expand = "true" / >
    < job id = "7" name = "TaskH" color = "#00cccc" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-03-15" duration = "103" full '1' = '1' priority = expand = "true" / >
    < job id = "8" name = "TaskI" color = "#0000ff" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = '2010-04-26' length = "11" complete = "0" priority = "1" expand = "true" / >
    < job id = '9' name = 'TaskJ"color =" #0000ff "form = meeting"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"="false"start = '2010-04-26' length ="11"complete ="0"priority ="1"expand ="true"/ >
    < job id = "10" name = "TaskK" color = "#000000" meeting = 'false' start time = "2010-07-12" = "65" full = "0" priority = "1" expand = "true" / >
    < / tasks >
    < resources / >
    < allowances / >
    < holiday / >
    -< taskdisplaycolumns >
    < displaycolumn property id = "tpd3" order = "0" width = "75" / >
    < displaycolumn property id = "tpd4" order = "1" width = "75" / >
    < displaycolumn property id = "tpd5" order = "2" width = "75" / >
    < displaycolumn property id = "tpd7" order = "3" width = "75" / >
    < / taskdisplaycolumns >
    < Previous / >
    < roles roles-name = "Default" / >
    < / project >

    Any ideas how to change the procedure, in order to merge the data in the xml document in the table?

    Thank you

    Hello

    Here's what you need in your USING clause:

    SELECT to_number(extractvalue(column_value, 'task/@id'))                as task_id,
           to_date(extractvalue(column_value, 'task/@start'), 'YYYY-MM-DD') as start_date,
           extractvalue(column_value, 'task/@name')                         as task_name
    FROM TABLE(
      XMLSEQUENCE(
        EXTRACT(xmltype(v_clob), '//task')
      )
    )
    

    Since you want nodes "task" request, just extract them directly. In addition, 'id', 'start', 'name' is attributes, you must access them with an '@'.

    You can also take a look at function XMLTABLE (which tends to replace construction TABLE (XMLSEQUENCE (...))):

    SELECT *
    FROM XMLTABLE(
     '//task'
     passing xmltype(v_clob)
     columns task_id    number(15)    path '/task/@id',
             start_date date          path '/task/@start',
             task_name  varchar2(100) path '/task/@name'
    )
    

    Edit: the XMLType constructor overload taking a BFILE type as an argument, so you can simplify the code a bit more:

    DECLARE
    
     v_xml XMLTYPE := XMLTYPE( BFILENAME('DTEMP', 'test.xml'), nls_charset_id('AL32UTF8') );
    
    BEGIN
    
    MERGE INTO project_table t
    USING (
      SELECT *
      FROM XMLTABLE(
       '//task'
       passing v_xml
       columns task_id    number(15)    path '/task/@id',
               start_date date          path '/task/@start',
               task_name  varchar2(100) path '/task/@name'
      )
    ) r
    ON (t.task_id = r.task_id)
    WHEN MATCHED THEN ...
    WHEN NOT MATCHED THEN ...
    ;
    
    ...
    
    END;
    

    HTH

    Published by: odie_63 on March 18, 2010 12:13

    Published by: odie_63 on March 18, 2010 12:15

  • Problem with loading of XML document

    Hello
    I have to load XML document uploaded on the web in XML DB and validate against the schema. The problem is, that:
    schemaLocation still looks like in the document like this:

    P1:schemaLocation = "SPDS. IFR.i009.pl http://inetsqlcg:82/ReportServer?%2fReportPublisher%2fspds.ifr.009.PL & amp; rs 3aFormat % = XML & amp; rc % 3aSchema = True'

    and cannot be changed.

    I registered schema by using the command:
    BEGIN
    DBMS_XMLSCHEMA.registerSchema
    (
    SCHEMAURL = >
    -UTL_URL. UNESCAPE
    ('http://inetsqlcg:82/ReportServer?%2fReportPublisher%2fspds.ifr.009.PL & amp; rs 3aFormat % = XML & amp; % 3aSchema rc = True'),
    SCHEMADOC = > BFILENAME ("TEST_DIR',"test.xsd").
    FORCE = > TRUE
    );
    END;

    (ORACLE inquired about the variable & amp, I set myself to & amp course :)))

    I used the FORCE to omit the error:
    ORA-31000: resource ' http://inetsqlcg:82/ReportServer?/ReportPublisher/spds.ifr.009.PL & amp; RS: Format = XML & amp; RC:schema = True' is not a document of schema XDB

    Now I have the schema with SCHEMA_URL
    Select SCHEMA_URL in the user_xml_schemas;
    http://inetsqlcg:82/ReportServer?%2fReportPublisher%2fspds.IFR.009.pl & amp; RS % 3aFormat = XML & amp; RC % 3aSchema = true

    but when I try to load the document like this
    INSERT INTO THE REP
    VALUES
    (
    XMLType
    (
    BFILENAME ("TEST_DIR", "test.xml"),
    NLS_CHARSET_ID ("AL32UTF8")
    )
    );

    There is an error:
    ORA-19007: Schema - does not http://inetsqlcg:82/ReportServer?%2fReportPublisher%2fspds.ifr.009.PL & amp; rs 3aFormat % = XML & amp; % 3aSchema rc = True expected.


    test.xsd is:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < xmlns = "spds.ifr.009.PL schema" xmlns: XS = "http://www.w3.org/2001/XMLSchema" xmlns:xdb = "http://xmlns.oracle.com/xdb" targetNamespace = "spds.ifr.009.PL" > "
    < xs: element name = "Report" xdb:defaultTable = "REP" >
    < xs: annotation >
    < intention > report < / intention >
    < / xs: annotation >
    < complexType xdb:SQLType = "REP_T" >
    < xs: Sequence minOccurs = "0" maxOccurs = "unbounded" >
    < xs: ELEMENT ref = "Detail" minOccurs = "0" maxOccurs = "unbounded" xdb:SQLName = "DETAILS" xdb:SQLCollType = "DETAILS_C" / >
    < / xs: SEQUENCE >
    < name XS: attribute = use 'REPORTNAME1' 'optional' = >
    < xs: annotation >
    XYZ abc < intention > < / intention >
    < / xs: annotation >
    < xs:simpleType >
    < xs:restriction base = "XS: String" / >
    < / xs:simpleType >
    < / xs: attribute >
    < / xs: complexType >
    < / xs: element >
    < xs: element name = "Details" xdb:defaultTable = "" >
    < xs: annotation >
    Details of < intention > < / intention >
    < / xs: annotation >
    < complexType xdb:SQLType = "DETAILS_T" >
    < name XS: attribute = "VALUATE" type = "xs: String" use = "optional" >
    < xs: annotation >
    < intention > Valuate < / intention >
    < / xs: annotation >
    < / xs: attribute >
    < name XS: attribute = "ISIN" use = "optional" >
    < xs: annotation >
    < intention > ISIN < / intention >
    < / xs: annotation >
    < xs:simpleType >
    < xs:restriction base = "XS: String" / >
    < / xs:simpleType >
    < / xs: attribute >
    < / xs: complexType >
    < / xs: element >
    < / xs: Schema >

    test.XML is:

    <? XML version = "1.0" encoding = "UTF-8"? >
    "< report xmlns:p1 ="http://www.w3.org/2001/XMLSchema-instance"xmlns ="spds.ifr.009.PL"p1:schemaLocation =" spds.ifr.009.PL http://inetsqlcg:82/ReportServer?%2fReportPublisher%2fspds.ifr.009.PL & amp; rs 3aFormat % = XML & amp; % 3aSchema rc = True "REPORTNAME1 ="abc abc abc">
    < detail ISIN = "AB0123456789" / >
    < detail ISIN = "XY0123456789" VALUE = "2" / >
    < / report >

    Version of the database is:
    11.1.0.7.0
    but probably I'll have to do the same thing on 10.2.0.3.0


    Any suggestion, please.

    And thanks in advance.

    Looks like we cannot manage this value of the schema location indicator... Not even sure we should, to be honest...

    You can use a workaround like this...

    SQL> VAR XMLSCHEMA CLOB
    SQL> VAR INSTANCE CLOB
    SQL> VAR SCHEMAURL VARCHAR2(700)
    SQL> --
    SQL> set define off
    SQL> --
    SQL> begin
      2     :SCHEMAURL := 'http://inetsqlcg:82/ReportServer?%2fReportPublisher%2fspds.ifr.009.PL&rs%3aFormat=XML&rc%3aSchema=True';
      3    :XMLSCHEMA :=
      4  '
      5  
      6     
      7             
      8                     Report
      9             
     10             
     11                     
     12                             
     13                     
     14                     
     15                             
     16                                     abc xyz
     17                             
     18                             
     19                                     
     20                             
     21                     
     22             
     23     
     24     
     25             
     26                     Details
     27             
     28             
     29                     
     30                             
     31                                     Valuate
     32                             
     33                     
     34                     
     35                             
     36                                     ISIN
     37                             
     38                             
     39                                     
     40                             
     41                     
     42             
     43     
     44  ';
     45    :INSTANCE :=
     46  '
     47  
     48  
     49  
     50  ';
     51  end;
     52  /
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.04
    SQL> --
    SQL> set define on
    SQL> --
    SQL> BEGIN
      2    DBMS_XMLSCHEMA.registerSchema
      3    (
      4       SCHEMAURL => :SCHEMAURL,
      5       SCHEMADOC => :XMLSCHEMA
      6    );
      7  END;
      8  /
    BEGIN
    *
    ERROR at line 1:
    ORA-31000: Resource
    'http://inetsqlcg:82/ReportServer?/ReportPublisher/spds.ifr.009.PL&rs:Format=XML
    &rc:Schema=True' is not an XDB schema document
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 72
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 33
    ORA-06512: at line 2
    
    Elapsed: 00:00:00.04
    SQL> desc REP
    ERROR:
    ORA-04043: object REP does not exist
    
    SQL> --
    SQL> INSERT INTO REP VALUES ( XMLTYPE(:INSTANCE ))
      2  /
    INSERT INTO REP VALUES ( XMLTYPE(:INSTANCE ))
                *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    
    Elapsed: 00:00:00.01
    SQL> --
    SQL> set define off
    SQL> --
    SQL> begin
      2     :SCHEMAURL := 'http://inetsqlcg:82/ReportServer';
      3    :XMLSCHEMA :=
      4  '
      5  
      6     
      7             
      8                     Report
      9             
     10             
     11                     
     12                             
     13                     
     14                     
     15                             
     16                                     abc xyz
     17                             
     18                             
     19                                     
     20                             
     21                     
     22             
     23     
     24     
     25             
     26                     Details
     27             
     28             
     29                     
     30                             
     31                                     Valuate
     32                             
     33                     
     34                     
     35                             
     36                                     ISIN
     37                             
     38                             
     39                                     
     40                             
     41                     
     42             
     43     
     44  ';
     45    :INSTANCE :=
     46  '
     47  
     48  
     49  
     50  ';
     51  end;
     52  /
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.01
    SQL> --
    SQL> set define on
    SQL> --
    SQL> BEGIN
      2    DBMS_XMLSCHEMA.registerSchema
      3    (
      4       SCHEMAURL => :SCHEMAURL,
      5       SCHEMADOC => :XMLSCHEMA
      6    );
      7  END;
      8  /
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:08.71
    SQL> desc REP
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
    TABLE of SYS.XMLTYPE(XMLSchema "http://inetsqlcg:82/ReportServer" Element "Report") STORAGE Object-relational TYPE "REP_T"
    
    SQL> --
    SQL> set long 10000
    SQL> select updateXML(XMLTYPE(:INSTANCE),'/Report/@p1:schemaLocation','spds.ifr.009.PL http://inetsqlcg:82/ReportServer','xmlns:p1="http://www.w3.org/2001/XMLSc
    hema-instance" xmlns="spds.ifr.009.PL"')
      2    from dual
      3  /
    
    UPDATEXML(XMLTYPE(:INSTANCE),'/REPORT/@P1:SCHEMALOCATION','SPDS.IFR.009.PLHTTP:/
    --------------------------------------------------------------------------------
    
    
      
      
    
    
    Elapsed: 00:00:00.03
    SQL> INSERT INTO REP VALUES ( updateXML(XMLTYPE(:INSTANCE),'/Report/@p1:schemaLocation','spds.ifr.009.PL http://inetsqlcg:82/ReportServer','xmlns:p1="http://www
    .w3.org/2001/XMLSchema-instance" xmlns="spds.ifr.009.PL"'))
      2  /
    
    1 row created.
    
    Elapsed: 00:00:00.01
    SQL> select * from REP
      2  /
    
    SYS_NC_ROWINFO$
    --------------------------------------------------------------------------------
    
    
      
      
    
    
    Elapsed: 00:00:00.56
    SQL>
    
  • every time I erase content and settings on my iphone 6 after reset at the start of my phone and after crossing the screen as Hello &gt; select language &gt; Connect wifi &gt; my iphone doesnot ask me activation lock even if my unit is also found on

    every time I erase content and settings on my iphone 6 after reset at the start of my phone and after crossing the screen as Hello > select language > wifi connection > my iphone doesnot ask me lock activation that says that your iphone is connected with the old apple ID, please enter the id and password

    I always reset on find my optional equipment please tell me how to activate locking activation so that whenever I have factory reset my phone with finding my camera so my phone always ask an old apple and password

    I do not understand your question, but let me go with what I believe. Looks like you entered in iCloud and erased all the content and settings on the iPhone, and once you go by assigning back up again, you do not see something that you expect to see, for example, a request for an Apple ID. When you go through the installation process to select the language, etc., it must, at some point, ask you to identify yourself with your Apple ID. are you not see this?

    It would be better if you try to describe exactly what you do again. Also, without the help of any sign of punctuation, it is difficult to track everything you ask. Try providing the steps of what you do, and then what you see when you get to the point that you believe that something is going wrong. You mention both an old and new Apple ID, which is rather confusing.

Maybe you are looking for

  • HP laptop computer 15: HP Notebook 15 Audio problem

    I updated my laptop to Windows 10 today and I realized that after the update I have not been able to hear the audio.  I tried troubleshooting, but it is said that the problem could not be identified and the volume is completely upward and I can't alw

  • I recvd error 'program compatibility problem' for my logitech g27 wheel.

    Logitech G27 Racing Wheel game controller I recvd 'compatibility problem program' error for my logitech g27 steering wheel wheel.it has been running for 1 1/2 years.

  • split a string

    I apologize for the display of a trivial question about separation of channels. I read through many suggestions for this and haven't seen a general answer. Chain: asd_dw_22_Lx - 2.gm How I divided this asd, dw, 22, Lx - 2.gm (clearly the components o

  • Where you can disable the message of Lenovo A2010 vibrate function

    Someone gave me a Lenovo 2010 as a gift which is already on Lolipop 5.1, GUI is a little different on my old A5000, that drives me crazy... Any idea on where I can find the option to disable vibrate when typing the SMS? Can't seem to find out where..

  • Problem with Vista

    Using Windows Vitsa Home Premium 64-bit for almost 2 years with relatively no problems. Until recently when I've updated as was recommended. After the upgrade, Adobe Flash Player will not work, and when I try to open a new word document, Internet Exp