Using EXTRACT XML data extraction

Hi, I have a XML file where I want to analyze the fields in a table in DB:

<? XML version = "1.0" encoding = "UTF-8"? >
< FIXML > < batch > < MktDataFull BizDt = '2012-07-13' > < Instrmt Sym = "JCPRXU" ID = "JCPRXU" Desc = "JCP.SR. XR. «USD"SecTyp ="CD"Src ="H"subtype = MMY" S "="201209"MatDt = ' 2012-09-20" Mult = Exch "0.01" = "CMD" UOM = "CTL" UOMCcy = "USD" UOMQty = "1" PxUOM = "IPNT" ValMeth = "CD" CpnRt = "1.0" IntAcrl = ' 2012-06-20 ' CpnPmt = ' 2012-09-20 ' NotnlPctOut = "100.0" Snrty = 'SR' RstrctTyp = 'XR' DayCntMeth = "ACT/360" tenor = "0 M" > < DITTA HELP = "US708130AC31" AltIDSrc = "105" / > < HELP AltID = "JCP.SR." "" ""» XR. USD.12U.100"AltIDSrc ="101"/ > < HELP DITTA = '1 201209 JCPRXU' AltIDSrc = 'H' / > < DITTA HELP ="1 201209 JCPRXU"AltIDSrc ="100"/ > < Evnt EventTyp ="5"Dt ="2008-09-19"/ > < Evnt EventTyp = '7' Dt = '2012-09-19' / > < Evnt EventTyp ="19"Dt ="2012-10-05"/ > < Evnt EventTyp ="100"Dt ="2012-07-16"/ > < Evnt EventTyp = '8' Dt ="2012-07-14"/ > < Evnt EventTyp = '9' Dt = '2012-09-20' / > < Evnt EventTyp ="101"Dt = '2012-03-20' / > < Evnt EventTyp ="102"Dt ="2008-09-20"/ > < Evnt EventTyp = « 103 » Dt = « 2008-09-22 » / >< Evnt EventTyp = « 104 » Dt = « 2012-09-19 » / >< Evnt EventTyp = « 111 » Dt = « 2012-09-20 » / >< Evnt EventTyp = « 112 » Dt = « 2012-06-20 » / >< Evnt EventTyp = « 113 » Dt = « 2012-03-20 » / >< Evnt EventTyp = « 114 » Dt = « 2012-07-12 » / >< Evnt EventTyp = « 115 » Dt = « 2012-07-16 » / >< / Instrmt >< complet Typ = « 6 » Px = Mkt « 99.7433368 » = « CMD » QCond = « 6 » PxTyp = « 1 » OpenClsSettlFlag = « 1 » >< / Full >< complet Typ = « 6 » Px = « 234.5254 » Mkt = QCond « CMD » = « 6 » PxTyp = « 6 » ' OpenClsSettlFlag = '1' > < / Full > < full Typ = "Y" Px = Mkt "40.0" = 'CMD' PxTyp = '1' OpenClsSettlFlag = '1' > < / Full > < full Typ = '6' Px = "234.5212" Mkt = QCond 'CMD' = '7' PxTyp = '6' OpenClsSettlFlag = '1' > < / Full > < full Typ = Mkt "B" = 'CMD' OpenClsSettlFlag = '4' Sz = '0' > < / Full > < full type = 'C' Mkt = 'CMD' OpenClsSettlFlag = '4' Sz = '0' > < / Full > < full Typ = 'z' Px = Mkt '0.18' = 'CMD' PxTyp = '1' OpenClsSettlFlag = '1 '. > < / full > < full Typ = 'y' Px = "0.1899965" Mkt = QCond 'CMD' = '6' PxTyp = '5' OpenClsSettlFlag = '1' > < / Full > < InstrmtExt > < Attrb Typ = '100' Val = '24' / > < Attrb Typ = '101' Val = '0' / > < Attrb Typ = '109' Val = '0' / > < Attrb Typ = '103' Val = '24' / > < Attrb Typ = '102' Val = '24' / > < Attrb Typ = '110' Val = '3' / > < Attrb Typ = '29' Val = 'Y' / > < Attrb Typ = '112' Val = 'Y ' /. > < / InstrmtExt > < / MktDataFull > < / batch > < / FIXML >


Right now, I'm just trying to extract the first 3 fields, BizDt, Bal and id I use to analyze the following:


SELECT
Extract (value (p), '/BizDt') .getStringVal () AS DATE_,.
Extract (value (p), ' /Instrmt/Sym').getStringVal (AS SYMBOL),)
Extract (value (p), ' /Instrmt/ID').getStringVal () AS ID_)

OF s TABLE_NAME.
TABLE (XMLSEQUENCE (Extract (xmlType.createXml (s.CDS_CLOB), ' FIXML/batch/MktDataFull / *'))) p
WHERE s.ID_ = 1

But I get nothing back. My guess is the because the XML data does not have opening tags and formal closing, because if I change my XML like this:

<? XML version = "1.0" encoding = "UTF-8"? >
< FIXML > < batch > < MktDataFull > < BizDt > 2012 - 07 - 13 < / BizDt > < Instrmt > < Sym > JCPRXU < / Sym > < ID > JCPRXU < /ID > < Desc > JCP.SR. XR. USD < / Desc > < SecTyp > CD < / SecTyp > < / Instrmt > < / MktDataFull > < / batch > < / FIXML >

I was able to get the data. Therefore, in order so solve this problem, what should I do with my original XML? Can I format the tags?

Thank you

When you nest xsl: for each of the elements, the select expression is evaluated in the context of the enclosing instance.

Consider this:


  

This means you are trying to match items complete as children Instrmt, that is not correct, because they are actually siblings.
In the same goes for HELP, Evnt etc.

I don't know what kind of structure you want.
Caps all does not much sense given that groups of brothers of repeat items that have no apparent correlation between them. Essentially, you end up with a big Cartesian product.

I would approach this by storing repeated elements in different tables with a parent/child relationship to preserve the hierarchical nature of the data (if necessary).

Tags: Oracle Development

Similar Questions

  • How to extract data using the xml data type

    Hello
    I tried the following example using the xml data type, but not the desired output.
    could you please correct the query in order to obtain the necessary
    CREATE TABLE TEST.EMP_DETAIL
    (
      EMPNO       NUMBER,
      ENAME       VARCHAR2(32 BYTE),
      EMPDETAILS  SYS.XMLTYPE
    )
    Insert into EMP_DETAIL
       (EMPNO, ENAME, EMPDETAILS)
     Values
       (7, 'Martin', XMLTYPE('<Dept>
      <Emp Empid="1">
        <EmpName>Kevin</EmpName>
        <Empno>50</Empno>
        <DOJ>20092008</DOJ>
        <Grade>E3</Grade>
        <Sal>3000</Sal>
      </Emp>
      <Emp Empid="2">
        <EmpName>Coster</EmpName>
        <Empno>60</Empno>
        <DOJ>01092008</DOJ>
        <Grade>E1</Grade>
        <Sal>1000</Sal>
      </Emp>
      <Emp Empid="3">
        <EmpName>Samuel</EmpName>
        <Empno>70</Empno>
        <DOJ>10052008</DOJ>
        <Grade>E2</Grade>
        <Sal>2530</Sal>
      </Emp>
      <Emp Empid="4">
        <EmpName>Dev</EmpName>
        <Empno>80</Empno>
        <DOJ>10032007</DOJ>
        <Grade>E2</Grade>
        <Sal>1200</Sal>
      </Emp>
    </Dept>
    '));
    I need to get the record for Empid = '2'
    Then tried the following query with no expected o/p
    SELECT a.empno,a.ename,a.empdetails.extract('//Dept/Emp/EmpName/text()').getStringVal() AS "EmpNAME",
         a.empdetails.extract('//Dept/Emp/Empno/text()').getStringVal() AS "EMPNumber",
          a.empdetails.extract('//Dept/Emp/DOJ/text()').getStringVal() AS "DOJ",
          a.empdetails.extract('//Dept/Emp/Grade/text()').getStringVal() AS "Grade",
          a.empdetails.extract('//Dept/Emp/Sal/text()').getStringVal() AS "Salary",
          a.empdetails.extract('//Dept/Emp[@Empid="2"]').getStringVal() AS "ID",
          a.empdetails.extract('//Dept/Emp[EmpName="Coster"]').getStringVal() AS "CHK"
         FROM emp_detail a 
         where empno=7  
               AND a.empdetails.existsNode('//Dept/Emp[@Empid="2"]') =1
    Thank you...

    Karthick_Arp wrote:
    I'm not very good at that... But if your XML code should not be more like this

    SQL> Insert into EMP_DETAIL
    2     (EMPNO, ENAME, EMPDETAILS)
    3   Values
    4     (7, 'Martin', XMLTYPE('
    5    
    6      1
    7      Kevin
    8      50
    9      20092008
    10      E3
    11      3000
    12    
    .. cut ..
    

    Why? It is perfectly valid to data as attributes rather than elements and also quite common for key values.

  • Script for the use of XML data to pre file form open using the player

    I need to pre fill five fields when the user opens the form using Acrobat Reader (title, name, address, etc.). The values are saved in an xml data file in the same directory as the form (no database or web services connections). I tested the xml code and form structures using shapes-> manage form data-> import data and everything works fine. Now, I need to emulate this behavior programmatically, so it does not work using only Acrobat Reader. I can't find the magic java script command to import the data (I tried xfa.host.importData and xfa.datasets.data.loadXML without result). Require purchase Pro or Livecycle Server product is not an option. This seems to be a basic requirement, so I hope I'm just being stupid and missing of which is obvious. Thank you.

    Hello

    Unless you're reader allowing the form with LiveCycle Reader Extensions ES, users with reader will NOT be able to import (or export) XML.

    Summary here: https://acrobat.com/#d=3lGJZAZuOmk8h86HCWyJKg

    Based on your description that you look at options 2 and 3, users with the reader.

    Sorry,

    Niall

  • WebView URL of XML data

    Hello

    I created a Listview and ListItemComponents .xml file

    I would like to open a WebView with the url selected in the .xml file, when a user clicks on an element.

    That's what I have so far:

    hand. QML

    import bb.cascades 1.0
    
    TabbedPane {
        showTabsOnActionBar: false
        Tab {
            title: "Home"
            imageSource: "asset:///images/custom/icon_197.png"
            Page {
                id: homepage
    
                titleBar: TitleBar {
                        title : "Title"
                    }
                    content: Container {
                        // Create a ListView that uses an XML data model
    
                        ListView {
                            dataModel: XmlDataModel {
                                source: "models/home.xml"
                            }
    
                            listItemComponents: [
    
                                ListItemComponent {
    
                                    type: "header"
    
                                    // Use a predefined Header to represent "header"
                                    // items
                                    Header {
                                        title: ListItemData.title
                                        subtitle: ListItemData.subtitle
                                    }
                                },
                                ListItemComponent {
                                    type: "listItem"
    
                                    // Use a predefined StandardListItem to represent "listItem"
                                    // items
                                    StandardListItem {
                                        title: ListItemData.title
                                        description: ListItemData.subtitle
                                        status: ListItemData.status
                                        imageSource: ListItemData.image
    
                                    }
    
                                } // end of second ListItemComponent
    
                            ]
                                            onTriggered: {
                                                var chosenItem = dataModel.data(indexPath);
    
                                                // Create the content page and push it on top to drill down to it.
                                                var page = webviewID.createObject();
    
                                                // Set the title and source of the feed that the user selected.
                                                page.weburl = ListItemData.weburl
                                                page.title = chosenItem.title
    
                                                nav.push(page);
                                            }
                             // end of listItemComponents list
                        } // end of ListView
                    } // end of Container
    
                actions: [
                    ActionItem {
                        title: "About"
                        imageSource: "asset:///images/custom/bb10/ic_info.png"
                    },
                    ActionItem {
                        title: "Settings"
                    }
                ]
    
            }
    
                 attachedObjects: [
                      ComponentDefinition {
                          id: webviewID
                          source: "webview.qml"
                      }
                  ]
    
        }
        Tab {
            title: "Options"
            Page {
                id: page2
                actions: [
                    ActionItem {
                        title: "Edit"
                    },
                    ActionItem {
                        title: "Save"
                    }
                ]
            }
        }
        Tab {
            title: "Help"
            Page {
                id: page3
                actions: [
                    ActionItem {
                        title: "Search"
                    },
                    ActionItem {
                        title: "Browse"
                    }
                ]
            }
        }
    
    }
    

    WebView.QML

    import bb.cascades 1.0
    
    Page {
        property alias title: titleBar.title
        property variant chosenItem
        property alias html: ListItemData.html
        property variant weburl
        titleBar: TitleBar {
            id: titleBar
        }
        WebView {
            id: webView
    
        }
    }
    

    Home.Xml

    
        http://www.google.nl"/>
        http://crackberry.com"/>
    
    

    Help, please!

    Thanks in advance, Jeroen

    The fixed.

    More info and code: http://forums.crackberry.com/bb-10-developers-hangout-f276/webview-url-xml-data-808285/

  • Extract XML data using XML table NULL recovery

    Hello

    I use XMLtable to recover data using XMLtable

    XML

    "< env:Envelope xmlns:env = ' http://schemas.xmlsoap.org/SOAP/envelope/ ">

    < env:Header > < / env:Header >

    < env:Body >

    " < = Xmlns:ns1 CreditBureauResponse ' http://www.example.org "xmlns =" " http://www.example.org ">

    < ns1:Body >

    < ns1:MGResponse > & lt; MGResponse xmlns = "urn: crif - messagegateway:2006 - 08-23" > & lt; U2:AUE_RES xmlns:u2 = "urn: AUE" > & lt; U2:response > & lt; U2:CBApplicationId > 123456789 & lt; / u2:CBApplicationId > & lt; U2:ProviderApplicationNo > 123 & lt; / u2:ProviderApplicationNo > & lt; U2:PreviousPhase > D & lt; / u2:PreviousPhase > & lt; U2:ActualPhase > D & lt; / u2: ActualPhase > & lt; U2:ApplicationDeleted > 0 & lt; / u2:ApplicationDeleted > & lt; / u2:Response > & lt; / u2:AUE_RES > & lt; / MGResponse > < / ns1:MGResponse >

    < / ns1:Body >

    < / CreditBureauResponse >

    < / env:Body >

    "< / env:Envelope >.

    I would like to know where I am going wrong

    SELECT x1.*

    OF tmp_xml_aue t.

    XMLTABLE (XMLNAMESPACES ('http://schemas.xmlsoap.org/soap/envelope/"as"env","http://www.example.org"as 'ns1", default'http://www.example.org'), )

    ' / env:Envelope / env:Body / CreditBureauResponse' T.OBJECT_VALUE by the WAY

    columns MGRESPONSE xmltype PATH "ns1:Body/ns1:MGResponse/text()") X 1,

    XMLTABLE (XMLNAMESPACES ("urn: crif - messagegateway:2006 - 08-23' as"v1", default" urn: AUE' '), ' / MGResponse/AUE_RES ' PASSAGE xmltype (DBMS_XMLGEN.convert (X 1.) MGRESPONSE. GETCLOBVAL(), 1))

    columns CBAPPLICATIONID varchar2 (15) WAY "response/CBApplicationId.

    ) X 2;

    Hello

    I saw your question and I hope that the link below will help you solve your solution:

    https://Oracle-base.com/articles/Misc/XMLTable-query-XML-data-from-SQL

    If there are problems more made me know I'll like you the exact solution for your query.

    Kind regards

    Vinoth.

  • extract data from blob field containing xml data big

    I'm working on Oracle 11 g 2, 11.0.2.0.3. UNIX database server.

    my oracle instance receive large xml data service web ftp, I put this file as blob in a table called TBL_ALERT_XML (ID_ALERT NUMBER, DATE of the TIMESTAMP_ALERT, ALERT_XML BLOB).

    My goal is to get data of BLOB content e file put in one or more other tables.

    I try with the opening of a cursor on

    SELECT XMLTYPE (UTL_RAW.cast_to_varchar2 (ALERT_XML)). Extract (' alerts/points/point / / Text () ') threads

    OF TBL_ALERT_XML

    without any filter on ID_ALERT.

    But I get the error:

    ORA-22835: buffer too small for to CHAR CLOB or BLOB to RAW conversion



    Please help me, thank you very much

    Because the web service is deployed in python and my co worker is not able to call a stored procedure with the parameter xmltype, but only with the setting of the BLOB.

    If you can't get around it, so be it. All the less, using CLOB would be better.

    However, which prevents you to convert BLOB XMLType entry within the stored procedure and store it in an XMLType column.

    To do this, simply use the XMLType of BLOB.

    create table tbl_alert_xml)

    number of id_alert

    date of timestamp_alert

    alert_xml xmltype

    );

    insert into tbl_alert_xml

    values)

    1

    sysdate

    xmltype (p_blob

    , nls_charset_id ('AL32UTF8') - put the encoding of the file here

    )

    );

    Then, you will be able to execute queries optimized using XMLTABLE.

  • Extraction of XML data and display new line

    I have a table named, SAPDATABROWSER, which has several columns and lines. A column named SAPTEXT (data type: CLOB) consist of xml data. Each XML data are different in terms of number of nodes, but has the same following structure:

    < SAP_BAPI_PROP >
    < SelectedProperty >
    < structure >
    < field > < / field >
    < length > < / length >
    < FieldValue > < / FieldValue >
    < type > < / Type >
    < priority > < / priority >
    < / structure >
    < / SelectedProperty >
    < / SAP_BAPI_PROP >

    So now, what I would do is, to extract the values: field, FieldValue and the length of each line (total 72) and see the result as follows.

    Length of track FieldValue
    XXXX YYYY ZZZZ
    PPPP QQQQ RRRR
    AAAA BBBB CCCC
    MMMM OOOO NNNN

    Again, each line (total 72) has several XML Data nodes, IE there are several nodes FieldType, length and field and no two XML data/line are similar!

    I use the following code:

    SELECT
    EXTRACT (xmltype (saptext), ' / SAP_BAPI_PROP/SelectedProperty/Structure/Field / text () ');
    EXTRACT (xmltype (saptext), ' / SAP_BAPI_PROP/SelectedProperty/Structure/Length / text () ');
    EXTRACT (xmltype (saptext), ' / SAP_BAPI_PROP/SelectedProperty/Structure/FieldValue / text () ')
    OF sapdatabrowser;

    The code above produces the following result:

    SAP_BAPI_PROP/.../Field/Text () SAP_BAPI_PROP/.../Length/text () SAP_BAPI_PROP/.../FieldValue/text)
    1 XXXXPPPPAAAA YYYYQQQQBBBB ZZZZRRRRCCCC
    2 MMMM OOOO NNNN


    Any suggestions? Thank you very much. :)

    Based on your sample data:

    SQL> select x.*
      2  from sapdatabrowser t
      3     , xmltable(
      4         '/SAP_BAPI_PROP/SelectedProperty/Structure'
      5         passing xmltype(t.saptext)
      6         columns field_name  varchar2(30) path 'Field'
      7               , field_len   varchar2(30) path 'Length'
      8               , field_val   varchar2(30) path 'FieldValue'
      9       ) x
     10  ;
    
    FIELD_NAME                     FIELD_LEN                      FIELD_VAL
    ------------------------------ ------------------------------ ------------------------------
    X                              Y                              Z
    P                              Q                              R
    A                              B                              C
    M                              N                              O
     
    

    (adjust the projected if necessary data types)

  • extract the pdf form xml data

    Hello

    What are the conditions to be able to extract data from a pdf form? I thought, that it is necessary to have the XML schema data connection and that all fields in the form must be bound to this data connection.

    But today I found, that domains can use the right connection 'use name (FieldName)', it's something by default - and that explicit data connection is necessary for this purpose.

    What is the common approach to the design of forms, which must be extracted by LC processFormSubmission?

    Thank you.

    All the data that is retrieved from an XFA form designed will be in xml format. The question then becomes how to control the format of the data that results. By default, the xml structure will follow the hierarchy (it is the Fieldname binding or binding normal use). If you want the data to follow a particular structure (so that you can use it with other systems that have a specific format) so that's when you would use sample XML or a schema in the data connection. Then by nodes of connection in the connection data in the fields, the form knows how to create the desired structure. If the structure is unimportant, then just stick with normal links and that no data connection is necessary.

    Hope that helps

    Paul

  • Extraction of XML data

    Hello

    I have a requirement to extract data from XML and insert in a custom table.

    XML structure is

    < A >

    < Column1 >

    < Column2 >

    < Column3 >

    < Column4 >

    < column > 5

    < A >

    < A1 >

    < Column1 >

    < Column2 >

    < Column3 >

    < Column4 >

    < column > 5

    < A1 >

    .

    .

    .

    .

    < a >

    < Column1 >

    < Column2 >

    < Column3 >

    < Column4 >

    < column > 5

    < a >


    I need to extract all the values in the column and insert it into a custom table.

    Number of nodes one will increase every day, and columns can be of the order of 50-100.


    With the help of EXTRACTVALUE and bulk collect I m doing this process, but taking almost 2 hours for the processing of 3000 records.


    Please let me know is there better way (in terms of performance) to extract XML data?


    Thank you

    Kumar.

    Why the node is called as A1, A2... One? Why can it not be Just A? Here's an example of how to represent XML report and analyzed data to a relational structure.

    SQL> with t
      2  as
      3  (
      4  select xmltype
      5         (
      6  '
      7      
      8           1
      9           ram
     10           01-01-2016
     11           10000
     12      
     13      
     14           2
     15           karthick
     16           01-01-2016
     17           10000
     18      
     19      
     20           3
     21           subha
     22           01-01-2016
     23           10000
     24      
     25      
     26           4
     27           vimal
     28           01-01-2016
     29           10000
     30      
     31      
     32           5
     33           vijay
     34           01-01-2016
     35           10000
     36      
     37  
    ' 38 ) xmldata 39 from dual 40 ) 41 select t1.* 42 from t 43 , xmltable 44 ( 45 '/table/row' passing xmldata 46 columns 47 empno number path 'empno', 48 ename varchar2(10) path 'ename', 49 doj varchar2(10) path 'doj', 50 sal number path 'sal' 51 ) t1; EMPNO ENAME DOJ SAL ---------- ---------- ---------- ---------- 1 ram 01-01-2016 10000 2 karthick 01-01-2016 10000 3 subha 01-01-2016 10000 4 vimal 01-01-2016 10000 5 vijay 01-01-2016 10000
  • extract xml data in the collection

    Hello

    I want to extract xml data in a collection of collection


    could any body you tell me if we succeed in sql
    ex:

    declare
    type t_code is table of number;
    type r_rec is record (c_name varchar2 (100),)
    c_code vrachar2 (100),
    c_code_number t_code);
    type t_rec is the table of the r_rec;

    l_xml xmltype: = xmltype (')

    < body >
    <>campaign
    < code > < code > CAMP_1
    < description > Campaign_1 < / description >
    < rateplans >
    < rateplanCode > 1 < / rateplanCode >
    < rateplanCode > 2 < / rateplanCode >
    < rateplanCode > 3 < / rateplanCode >
    < / rateplans >
    < / campaign >
    <>campaign
    < code > < code > CAMP_2
    < description > Campaign_2 < / description >
    < rateplans >
    < > 11 rateplanCode < / rateplanCode >
    < > 22 rateplanCode < / rateplanCode >
    < rateplanCode > 33 < / rateplanCode >
    < / rateplans >
    < / campaign >
    <>campaign
    < code > < code > CAMP_3
    < description > Campaign_3 < / description >
    < rateplans >
    < > 111 rateplanCode < / rateplanCode >
    < > 222 rateplanCode < / rateplanCode >
    < > 333 rateplanCode < / rateplanCode >
    < / rateplans >
    < / campaign >
    < result >
    < > 00 resultCode < / resultCode >
    < resultText > success < / resultText >
    < / result >
    (< / body > ');

    Start

    Select / * logic exrat value of xml in the final collection * /.
    Double;

    end;

    I want data in the model in my final collection t_rec

    CAMP_1, Campaign_1, nested_table (1,2,3)
    CAMP_2, Campaign_2, nested_table (11,22,33)
    CAMP_3, Campaign_3, nested_table (111,222,333)

    Published by: 948596 on May 17, 2013 05:17

    Like this

    SQL> declare
      2       type t_code is table of number ;
      3       type r_rec is record
      4       (
      5          c_name varchar2(100),
      6          c_code varchar2(100),
      7          c_code_number t_code
      8       );
      9       type t_rec is table of r_rec ;
     10       l_rec t_rec := t_rec();
     11       l_xml xmltype := xmltype
     12                        ('
     13                           
     14                           
     15                           CAMP_1
     16                           Campaign_1
     17                           
     18                           1
     19                           2
     20                           3
     21                           
     22                           
     23                           
     24                           CAMP_2
     25                           Campaign_2
     26                           
     27                           11
     28                           22
     29                           33
     30                           
     31                           
     32                           
     33                           CAMP_3
     34                           Campaign_3
     35                           
     36                           111
     37                           222
     38                           333
     39                           
     40                           
     41                           
     42                           00
     43                           Success
     44                           
     45                           '
     46                        ) ;
     47  begin
     48       for i in (
     49                 select rownum id
     50                      , t1.code
     51                      , t1.description
     52                      , t2.rate_plan_code
     53                      , row_number() over(partition by t1.code order by t2.rate_plan_code) rno
     54                   from xmltable
     55                        (
     56                             '/body/campaign' passing l_xml
     57                             columns
     58                               code        varchar2(100) path 'code',
     59                               description varchar2(100) path 'description',
     60                               rate_plans  xmltype       path 'rateplans'
     61                        ) t1
     62                      , xmltable
     63                        (
     64                             '/rateplans/rateplanCode' passing t1.rate_plans
     65                             columns
     66                               rate_plan_code varchar2(100) path '.'
     67                        ) t2
     68                )
     69       loop
     70            if i.rno = 1 then
     71               l_rec.extend;
     72               l_rec(l_rec.count).c_name := i.description;
     73               l_rec(l_rec.count).c_code := i.code;
     74               l_rec(l_rec.count).c_code_number := t_code();
     75            end if;
     76            l_rec(l_rec.count).c_code_number.extend;
     77            l_rec(l_rec.count).c_code_number(i.rno) := i.rate_plan_code;
     78       end loop;
     79       for i in 1..l_rec.count
     80       loop
     81          dbms_output.put_line(l_rec(i).c_code || '  ' || l_rec(i).c_name);
     82          for j in 1..l_rec(i).c_code_number.count
     83          loop
     84             dbms_output.put_line(l_rec(i).c_code_number(j));
     85          end loop;
     86       end loop;
     87  end;
     88  /
    CAMP_1  Campaign_1
    1
    2
    3
    CAMP_2  Campaign_2
    11
    22
    33
    CAMP_3  Campaign_3
    111
    222
    333
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    
  • Loading XML data in ListView of C++ after extraction of http data

    I'm sorry did searh but could not find any refrence related to my problem
    I am trying to load the xml data returned from a web service HTTP Post QNetworkRequest and QNetworkReply in c ++.

    My XML that gets donwloaded is as

    
     http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
      
        tu7652
        F
        Marry
        Wijaya
      
      
        23
        F
        Marry
        Wijaya
      
    
    

    In My QML, it comes to the ListView can say SearchResult.qml

    ListView {
              objectName: "resultlist"
              dataModel: feedsdatamodel
              listItemComponents: [
                ListItemComponent {
                            type: "item"
                            PeopleListItem {
                                name: ListItemData.givenName + ", " + ListItemData.sn
                                role: ListItemData.ExtFunction
                                leftPaddingText: 40
                            }
                        }
               ]
            }
     attachedObjects: [
           // The data model that contains the content of a XML file
            GroupDataModel {
                id: feedsDataModel
                sortingKeys: [
                    "givenName"
                ]
                grouping: ItemGrouping.None
            }
        ]
    

    PeopleListItem.qml

    import bb.cascades 1.0
    
    Container {
        property alias name: titleLabel.text
        property alias role: functionLabel.text
        property alias leftPaddingText: textcontainer.leftPadding
    
        layout: StackLayout {
            orientation: LayoutOrientation.TopToBottom
        }
        preferredWidth: 768
        preferredHeight: 135
        Container {
    
            id: textcontainer
            topPadding: 10
    
            layout: StackLayout {
                orientation: LayoutOrientation.TopToBottom
            }
            Label {
    
                id: titleLabel
                textStyle.base: SystemDefaults.TextStyles.TitleText
                textStyle.color: Color.Black
            }
            Label {
                id: functionLabel
                textStyle.base: SystemDefaults.TextStyles.BodyText
                textStyle.color: Color.Gray
            }
        }
        Divider {
            verticalAlignment: VerticalAlignment.Bottom
        }
    }
    

    This is the function I'm using to display the QML it is called from main.qml and works correctly.

    void PeopleFinder::onSearchClicked() {
        qDebug() << "PeopleFinder::PeopleFinder::onSearchClicked::\t" << "begin";
        qDebug() << "PeopleFinder::PeopleFinder::onSearchClicked::\tfname:"
                << m_fname << "\tlname:" << m_lname;
    
        // Create a network access manager and connect a custom slot to its
        // finished signal
        mNetworkAccessManager = new QNetworkAccessManager(this);
    
        // create a data model with sorting keys for lastname and firstname
        Q_ASSERT(
                connect(mNetworkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*))));
    
        //Load the bew QML file of Search from here
        QmlDocument *qml = QmlDocument::create("asset:///SearchResults.qml").parent(
                this);
        qml->setContextProperty("peoplefinder", this);
    
        Page *mypage = qml->createRootObject();
        qml->setParent(mypage);
        qDebug() << "PeopleFinder::PeopleFinder::onSearchClicked::\t s444444";
    
        // Retrieve the activity indicator from QML so that we can start
        // and stop it from C++
    //  mActivityIndicator = mypage->findChild("myIndicator");
    
        // Retrieve the list so we can set the data model on it once
        // we retrieve it
        mListView = mypage->findChild("resultlist");
    
        mNavigator->push(mypage);
    }
    

    Once the page loads in the QML it call the launch request providing c ++ file and once the
    query is completed under function is called with the data. I checked that data are downloaded properly

    void PeopleFinder::requestFinished(QNetworkReply* reply) {
        qDebug() << "PeopleFinder::PeopleFinder::requestFinished::\t"
                << "response received";
        // Check the network reply for errors
        if (reply->error() == QNetworkReply::NoError) {
    
            // Open the file and print an error if the file cannot be opened
            qDebug() << "PeopleFinder::PeopleFinder::requestFinished::\t"
                    << "No error";
    
            // Write to the file using the reply data and close the file
            QByteArray xml = reply->readAll();
            qDebug() << "Data: \n" << xml;
    
            // load the xml data
            XmlDataAccess xda;
            QVariant list = xda.load(xml, "ArrayOfPeople");
    
            qDebug() << "List:::\n" << list;
    
            GroupDataModel *datamodel = (GroupDataModel*)mListView->dataModel();
            // add the data to the model
            datamodel->clear();
            datamodel->insertList(list.value());
            datamodel->setSortingKeys(QStringList() << "givenName" << "sn");
            qDebug() << "PeopleFinder::PeopleFinder::requestFinished::\t"
                    << "Datamodel set size:: " << datamodel->size();
    
            // Set the new data model on the list and stop the activity indicator
    
        } else {
            qDebug() << "\n Problem with the network";
            qDebug() << "\n" << reply->errorString();
        }
    }
    

    But now, the real problem begins as in how to convert QByteArray data type of QVariantList which can be loaded into the datamodel
    I don't want to write the data to the XML file and then pass that as a list his will is very slow, once I move test environment to the production environment.

    Please help me solve this problem

    I got it to work using xml parsing with QXmlStreamReader

  • Extract XML data to a text box

    How could I get the XML data a box?

    Course code: (it will not display anything!)

    var dyoXML:XML = new XML();
    dyoXML.ignoreWhite = true;

    dyoXML.onLoad = {function (success)}
    {if (Success)}
    disemail. Text = This;
    }
    }

    dyoXML.load ("http://www.myweb.com/mails.php");

    you not set $fin in your php file.  use:

    $fin = $_POST ['end'];

    to define it.  and you should be specifying the POST method to send data to your php file.  (unless you send end via the query string that you aren't.)

  • Select this OPTION to generate XML data from the table using XMLELEMENT, XMLAGG gives error ORA-19011 string buffer too small

    My select statement fails with the error:


    The ORA-19011 string buffer too small


    The select statement looks like:


    SELECT TO_CLOB)

    XMLELEMENT ("accounts",

    XMLELEMENT ("count",

    XMLATTRIBUTES)

    rownum AS "recordId."

    To_date('20130520','YYYYMMDD') AS "datestarted."

    123456 AS "previousBatchId."

    56789 AS 'previousRecordId '.

    ),

    ....

    .... .

    .....

    XMLFOREST)

    SIG_ROLE AS "SignatoryRole."

    To_char(TRANSFER_DATE,'YYYY-mm-DD') AS "TransferDate."

    NVL(Reason,0) AS 'reason '.

    ) AS the 'transfer '.

    )

    ()) AS CRDTRPT

    OF ANY_TABLE;

    • It looks like I can choose only 4000 characters using the SELECT statement (please, correct me if I'm wrong)

    I'd use the XMLGEN package. But the environment team says no mounted drives in the future with the arrival of the EXADATA.

    NO HARD DRIVE MOUNTED, NO ACCESS TO THE DATABASE DIRECTORIES

    No UTL_FILE

    I need to use the REEL spool the resulting XML data of the SELECT query.

    SQL is a standard in my org, but I can do with a PL/SQL solution also to load data into a table (cannot use a COIL with PL/SQL)

    What I do is:

    1. a column of type CLOB to a xml_report of the loading of the above SELECT query table
    2. Then using SELECT * FROM xml_report to SPOOL the data to a file report.xml

    No need of XMLTYPE data behind. Xml data stream is fine for me.

    In addition, I need to validate the XML file, also using XSD.

    Problem is that the resulting lines of the select query are supposed to be from 15000 to 20000 bytes long.

    Oracle database version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    A Suggestion or a solution to this problem would be appreciated.

    (Sorry for the use of "BOLD", just to make it more readable and highlight the imp points)

    Bravo!

    Rahul

    It looks like I can choose only 4000 characters using the SELECT statement (please, correct me if I'm wrong)

    You use the right method.

    There is an implicit conversion from XMLType to the data type VARCHAR2 as expected by the function TO_CLOB, where the limitation, and the error.

    To serialize XMLType to CLOB, use the XMLSerialize function:

    SELECT XMLSerialize (DOCUMENT

    XMLELEMENT ("accounts",

    ...

    )

    )

    OF ANY_TABLE;

    For the rest of the requirement, I wish you good luck trying to spool the XML correctly.

    You may need to play around with the SET LONG and SET LONGCHUNKSIZE commands to operate.

  • Replace the XML data using AS3

    I have a file called temp.xml saved on the localhost (I'm under wamp to test), and it has this in it:

    <?xml version="1.0" encoding="utf-8"?>
    <1>
    <SAVEDATA pos="1"/>
    </1>
    

    The idea is, you get to control pos points = "" could be updated. " I can't understand how to actually change it. SAVEDATA is located in < 1 > it is because I wanted to also give somehow a unique ID to each player (there is a system of connection), and when you connect, it checks your ID and continues the game where you left off.

    If you use the XML, as I've shown, you can use the following to load and change the attribute of retail:

    Load it

    var urlLoader:URLLoader = new URLLoader();

    urlLoader.addEventListener (Event.COMPLETE, f);

    urlLoader.load (new URLRequest ("test2.xml"));

    var xml;

    function f(e:Event):void {}

    XML = XML (e.target.data);

    }

    editing xml: (for example to change player with id = '3' for pos = '7', use editXMLF (3.7);)

    you don't need to change any code above or below except the parameters you pass when you call editXMLF

    function editXMLF(playerID:int,_newPOS:int):void {}

    XML. Player. (@id == playerID.toString ()). SaveData.@POS = newPOS;

    }

  • How to load xml using sql loader data?

    Is there any load script of XML data in a table through sql loader?

    Help me out here...

    Thank you

    You can post your code here? while I can help you... your code format should be like this...

    Example code:

    DOWNLOAD THE DATA

    INFILE *.

    IN THE TABLE po_tab

    ADD

    XMLTYPE (xmldata)

    FIELDS

    (xmldata TANK (2000))

    BEGINDATA

    "" http://www.Oracle.com/po/"xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"

    "" xsi: schemaLocation = "http://www.oracle.com/PO http://www.oracle.com/scha0/po1.xsd"

    orderDate = "1999-10-20" >

    Alice Smith

    123 maple Street

    Mill Valley

    CA

    90952

    Robert Smith

    8 oak Avenue

    Old town

    PA

    95819

    Hurry, my lawn is going wild!

    Lawn mower

    1

    148.95

    Confirm this is electric

    Baby monitor

    1

    39.98

    1999-05-21

Maybe you are looking for

  • HP nc8430

    Nice day I installed win7 64 b on HP nc8430... When I I c onnecter for external LCD screen, it says no signal do I have to load drivers AVG? If Yes can you kindly helped me with them. Thank you

  • Incomplete backups after the recent firmware update (ReadyNas NV +) 4.1.15

    Hi, I had the system work perfectly without any problems until he informed me of the 4.1.15 updated. I went ahead with the update and now the backups are incomplete. It stops around folders starting with Mr. to make things worse, backups are reported

  • Satellite A210-ICO - what HARD drive I can use?

    I'm getting bad sectors on the hard drive of my laptop, so I guess I should pay for a new one – but who are able to A210-1CO? TA, M

  • NAS200 - cannot access personal folders of Windows

    Live chat with Linksys re: NAS200: my side of it. On a NAS200 I install a user called 'jon' with a personal file and a password. Problem is, I don't see how now to access folder Jon of Windows XP in the same way that I can access the public folder. I

  • AnyConnect &amp; authentication digital certificate

    people I have a question about the authentication of users with digital certificates and name of user and password My ssl vpn works well but I have only one user so far my query is about how to manage certificates and additional users I'll add the us