Analyze XML data

Hello

DB version 11.2.0.1

I clob with the name 'a' table dummy_clob include date of XML, I need to select these data, but there is error apper ORA-19228: XPST0008

Query:

SELECT x.Cba_Number,x.Reference_Id
  FROM dummy_clob t,
       XMLTABLE (
           '/ns2:SearchResponseType xmlns:ns2="##default" xmlns="urn:com.xxx:xxx:xxx:1"'
           PASSING xmltype (t.a)
           COLUMNS Cba_Number VARCHAR2 (2000) PATH 'CbaNumber',
                   Reference_Id VARCHAR2 (2000) PATH 'ReferenceId') x

XML:

<ns2:SearchResponseType xmlns:ns2="##default" xmlns="urn:com.xxx:xxx:xxx:1">
    <CbaNumber>29291618</CbaNumber>
    <ReferenceId>123459</ReferenceId>
</ns2:SearchResponseType>

To add namespace declarations to the function xmltable initially:

SELECT x.Cba_Number, x.Reference_Id

T,.

XMLTABLE)

XmlNamespaces (' #default # ' as "ns2", default 'urn:com.xxx:xxx:xxx:1')

,'/ ns2:SearchResponseType'

PASSAGE xmltype (t.a)

COLUMNS Cba_Number VARCHAR2 (2000) PATH "CbaNumber."

Reference_Id VARCHAR2 (2000) PATH 'ReferenceId '.

) x

Tags: Database

Similar Questions

  • 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
  • The analysis of the external Web service XML data IS

    Hi all

    I'm looking to analyze the data returned by the Scopus API with Apex webservice.

    First of all, I tried parsing the JSON, however, it seems that the apex_json.parse function does not produce a result when the string contains a ':' character.  (It looks a lot like the webservice returns returns a JSON XML version below, namespace and all).

    I moved from the attempt to analyze the XML code that is less a model to:

    <?xml version="1.0" encoding="UTF-8"?>
    <search-results xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" 
    
    xmlns:prism="http://prismstandard.org/namespaces/basic/2.0/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/2005/Atom">
      <opensearch:totalResults>2</opensearch:totalResults>
      <opensearch:startIndex>0</opensearch:startIndex>
      <opensearch:itemsPerPage>2</opensearch:itemsPerPage>
      <opensearch:Query role="request" startPage="0" searchTerms="authlast%28ryan%29+and+af-id%2860017837%29"/>
      <link type="application/xml" href="http://api.elsevier.com:80/content/search/author?start=0&count=25&query=authlast%28ryan%29+and+af-id
    
    %2860017837%29" ref="self"/>
      <link type="application/xml" href="http://api.elsevier.com:80/content/search/author?start=0&count=25&query=authlast%28ryan%29+and+af-id
    
    %2860017837%29" ref="first"/>
      <entry>
        <link href="http://api.elsevier.com/content/author/author_id/7402922277" ref="self"/>
        <link href="http://api.elsevier.com/content/search/author?query=au-id%287402922277%29" ref="search"/>
        <link href="http://www.sco pus.com/author/citedby.url?partnerID=HzOxMe3b&citedAuthorId=7402922277&origin=inward" ref="scopus-
    
    citedby"/>
        <link href="http://www.scopus.com/authid/detail.url?partnerID=HzOxMe3b&authorId=7402922277&origin=inward" ref="scopus-author"/>
        <prism:url>http://api.elsevier.com/content/author/author_id/7402922277</prism:url>
        <dc:identifier>AUTHOR_ID:7402922277</dc:identifier>
        <eid>9-s2.0-7402922277</eid>
        <preferred-name>
          <surname>Ryan</surname>
          <given-name>Philip J.</given-name>
          <initials>P.J.</initials>
        </preferred-name>
        <name-variant>
          <surname>Ryan</surname>
          <initials>P.J.</initials>
        </name-variant>
        <name-variant>
          <surname>Ryan</surname>
          <given-name>P. J.</given-name>
          <initials>P.</initials>
        </name-variant>
        <name-variant>
          <surname>Ryan</surname>
          <given-name>Phil</given-name>
          <initials>P.J.</initials>
        </name-variant>
        <document-count>28</document-count>
        <subject-area frequency="47" abbrev="AGRI">Agricultural and Biological Sciences (all)</subject-area>
        <subject-area frequency="24" abbrev="EART">Earth and Planetary Sciences (all)</subject-area>
        <subject-area frequency="15" abbrev="ENVI">Environmental Science (all)</subject-area>
        <affiliation-current>
          <affiliation-url>http://api.elsevier.com/content/affiliation/affiliation_id/60006905</affiliation-url>
          <affiliation-id>60006905</affiliation-id>
          <affiliation-name>CSIRO Forestry and Forest Products</affiliation-name>
          <affiliation-city>Kingston</affiliation-city>
          <affiliation-country>Australia</affiliation-country>
        </affiliation-current>
      </entry>
      <entry>
        <link href="http://api.elsevier.com/content/author/author_id/56970474800" ref="self"/>
        <link href="http://api.elsevier.com/content/search/author?query=au-id%2856970474800%29" ref="search"/>
        <link href="http://www.s copus.com/author/citedby.url?partnerID=HzOxMe3b&citedAuthorId=56970474800&origin=inward" ref="scopus-
    
    citedby"/>
        <link href="http://www.scopus.com/authid/detail.url?partnerID=HzOxMe3b&authorId=56970474800&origin=inward" ref="scopus-author"/>
        <prism:url>http://api.elsevier.com/content/author/author_id/56970474800</prism:url>
        <dc:identifier>AUTHOR_ID:56970474800</dc:identifier>
        <eid>9-s2.0-56970474800</eid>
        <preferred-name>
          <surname>Ryan</surname>
          <given-name>Peta</given-name>
          <initials>P.</initials>
        </preferred-name>
        <document-count>1</document-count>
        <subject-area frequency="2" abbrev="NURS">Nursing (all)</subject-area>
        <affiliation-current>
          <affiliation-url>http://api.elsevier.com/content/affiliation/affiliation_id/60017837</affiliation-url>
          <affiliation-id>60017837</affiliation-id>
          <affiliation-name>University of New England Australia</affiliation-name>
          <affiliation-city>Armidale</affiliation-city>
          <affiliation-country>Australia</affiliation-country>
        </affiliation-current>
      </entry>
    </search-results>
    

    So far, the best I could do is to extract the total results by XMLTable:

    SELECT results.totalResults INTO numResults FROM
        XMLTable(
            XMLNamespaces(
                default 'http://www.w3.org/2005/Atom',
                'http://prismstandard.org/namespaces/basic/2.0/' as "prism",
                'http://a9.com/-/spec/opensearch/1.1/' as "opensearch",
                'http://purl.org/dc/elements/1.1/' as "dc"),
            '/search-results' PASSING xmlResult
             COLUMNS
             totalResults NUMBER PATH '//opensearch:totalResults') results;
    

    I'm not convinced that using XMLTable is the best solution, but that's what I've learned to work.  Take it further proves to be more problematic.

    Ideally, what I want to do is get the Subproperty, favorite-name/given-name, favorite-name/initials, favorite-name and affiliation-affiliation/current-name in a collection, as well as the entrance of <>... < / input >.  The user can then select the correct author, and we can use the full set of data to process.

    I'm sure that my problem comes down to manage multiple with XPath, although namespaces that putting my XPath through Validator online gives the desired result, it does not work for me in my PL/SQL.

    If someone could provide some tips and suggestions, I would be very grateful.


    Thank you very much


    Andrew Rochdale-Meares

    Andrew Rochdale-Meares wrote:

    I'm looking to analyze the data returned by the Scopus API with Apex webservice.

    I moved from the attempt to analyze the XML code that is less a model to:

    So far, the best I could do is to extract the total results by XMLTable:

    1. SELECT results.totalResults INTO numResults OF
    2. XMLTable)
    3. XMLNamespaces)
    4. default "http://www.w3.org/2005/Atom",.
    5. "http://prismstandard.org/namespaces/basic/2.0/" as "Prism,"
    6. "http://a9.com/-/spec/opensearch/1.1/" as "opensearch".
    7. ("http://purl.org/dc/elements/1.1/" as "dc").
    8. ' / search result PASSING xmlResult
    9. COLUMNS
    10. totalResults NUMBER PATH ' / / ' opensearch:totalResults) results;

    I'm not convinced that using XMLTable is the best solution, but that's what I've learned to work.  Take it further proves to be more problematic.

    Ideally, what I want to do is to get the Subproperty, favorite-name/given-name, favorite-name/initials, favorite-name and affiliation-current/affiliation-name in a collection, as well as of the ..  The user can then select the correct author, and we can use the full set of data to process.

    The results using XMLTable of shredding is the best way to get results in a collection.

    I'm sure that my problem comes down to manage multiple with XPath, although namespaces that putting my XPath through Validator online gives the desired result, it does not work for me in my PL/SQL.

    It is not clear where you encountered problems because no details of the attempts to obtain the required information has been provided. Is not clear from the description exactly what "...". along with the ..." means, so I assumed that you want to store this item as an XML fragment in the collection. It is therefore necessary to use a loop with apex_collection.add_member as the most effective create_collection_from_queryb2 method doesn't have support to complete the collection XML column:

    ...
    
      /* Assuming the xmlResult variable is set somewhere previously... */
    
      apex_collection.create_or_truncate_collection('SCOPUS_RESULTS');
    
      for scopus_entry in (
        select
            se.*
        from
            xmltable(
                xmlnamespaces(
                    default 'http://www.w3.org/2005/Atom'
                  , 'http://prismstandard.org/namespaces/basic/2.0/' as "prism"
                  , 'http://a9.com/-/spec/opensearch/1.1/' as "opensearch"
                  , 'http://purl.org/dc/elements/1.1/' as "dc")
              , '/search-results/entry'
                passing xmlResult
                columns
                    dc_identifier    varchar2(64 char)  path 'dc:identifier'
                  , given_name       varchar2(64 char)  path 'preferred-name/given-name'
                  , initials         varchar2(64 char)  path 'preferred-name/initials'
                  , surname          varchar2(64 char)  path 'preferred-name/surname'
                  , affiliation_name varchar2(256 char) path 'affiliation-current/affiliation-name'
                  , entry_xml        xmltype            path '.') se)
      loop
        apex_collection.add_member(
            p_collection_name => 'SCOPUS_RESULTS'
          , p_c001 => scopus_entry.dc_identifier
          , p_c002 => scopus_entry.given_name
          , p_c003 => scopus_entry.initials
          , p_c004 => scopus_entry.surname
          , p_c005 => scopus_entry.affiliation_name
          , p_xmltype001 => scopus_entry.entry_xml);
      end loop;
    
    ...
    
  • source of XML data in the db column?

    Hello world

    If I want to use XML data as the source of data for BI Publisher, these data can be stored in a column of data

    or do I have to store the data from the source XML files in a file system?

    If it can be stored in a column db - is there something I need to consider regarding the definition of the data source and the creation of the data model?

    Thank you

    Concerning

    Andy

    These data can be stored in a column of data

    or do I have to store the data from the source XML files in a file system?

    Yes

    the data can be stored in

    (1) table xmltype or clob or blob column or...

    so you can analyze this column somehow by xquery or xmltable or...

    (2) in the file of the bone

    bfilename as therapy

    xmltype( bfilename('GET_XML', xmlfilename.xml))
    
  • inserting XML data in a table

    Hello

    I have a procedure that takes xmltype as input parameter that contains data such as:

    <? XML version = "1.0"? >
    rowset <>
    < ROW >
    < > 7782 EMPNO < / EMPNO >
    CLARK < ENAME > < / ENAME >
    MANAGER < JOB > < / JOB >
    < MGR > 7839 < / MGR >
    < HIREDATE > 9 June 81 < / HIREDATE >
    < SAL > 2450 < / SAL >
    < DEPTNO > 10 < / DEPTNO >
    < / ROW >
    < ROW >
    < > 7839 EMPNO < / EMPNO >
    KING of < ENAME > < / ENAME >
    PRESIDENT < JOB > < / JOB >
    < HIREDATE > 17 November 81 < / HIREDATE >
    < SAL > 5000 < / SAL >
    < DEPTNO > 10 < / DEPTNO >
    < / ROW >
    < ROW >
    < > 7934 EMPNO < / EMPNO >
    MILLER < ENAME > < / ENAME >
    CLERK of < JOB > < / JOB >
    < MGR > 7782 < / MGR >
    < HIREDATE > 23 January 82 < / HIREDATE >
    < SAL > 1300 < / SAL >
    < DEPTNO > 10 < / DEPTNO >
    < / ROW >
    < / LINES >

    I analyze this data and insert into the employee table.
    I remember that using the extract function we can do, but I do not get it exactly.

    Can you please help me in this.

    Thank you
    Vinod

    See [url http://docs.oracle.com/cd/E14072_01/server.112/e10592/functions251.htm#CIHGGHFB] XMLTABLE

    For example:

    -- INSERT INTO 
    
    WITH x AS
    (SELECT XMLTYPE('
    
    
    7782
    CLARK
    MANAGER
    7839
    09-JUN-81
    2450
    10
    
    
    7839
    KING
    PRESIDENT
    17-NOV-81
    5000
    10
    
    
    7934
    MILLER
    CLERK
    7782
    23-JAN-82
    1300
    10
    
    ') myxml
    FROM DUAL)
    SELECT *
    FROM   x
    ,      XMLTABLE('/ROWSET/ROW'
             PASSING x.myxml
             COLUMNS empno, ename, job, mgr, hiredate, sal, deptno); 
    
  • 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).

  • Construction of a game based on XML data screen

    I just put a list of clips on the screen using the data of positioning of an xml document.

    I created 2 movieClips in my library with the link of the box01 class and box02.

    I have an xml document that describes the x and there contact information I want to use:


    <? XML version = "1.0" encoding = "iso-8859-1? >
    < data >
    < name of art = "box01" x = "50" y = "50" / >
    < name of art = "box02" x = "100" y = "100" / >
    < / data >

    I am able to analyze this xml document in flash and see the data:
    trace(XMLDATA.art[0].@Name) displays "box01.

    Now I want to loop through the length of my elements of 'art' xml and generate my screen (by calling the movieClips box01 and box02 located in the library).

    But I don't know how to use the name box01, box02 etc of the doc xml to create my case.

    It works, but more or less like this:

    var i: uint;
    for (i = 0; i < xmldata.art.length (); i ++) {}
    trace (XMLDATA.art, , .@name);
    var myMovieClip: [xmldata.art
    .@name] = new [xmldata.art .@name] ();
    myMovieClip.x = xmldata.art
    .@x.
    myMovieClip.y = xmldata.art .@y.
    addChild (myMovieClip);
    }


    Sound this line that I need the help of the syntax on:

    var myMovieClip: [xmldata.art
    .@name] = new [xmldata.art .@name] ();


    I want the name of my case to be the 'name' of my xml doc attribute.

    I'm close - could someone please help me understand this?

    Thanks - I'll put my complete code below.








    -COMPLETE ACTION SCRIPT-

    package {}
    import flash.display. *;
    import flash.events. *;
    import flash.net.URLLoader;
    import flash.net.URLRequest;

    public class myXMLDoc extends MovieClip {}
    private var xmldata:XML;

    public void myXMLDoc() {}
    XMLDATA = new XML();
    var xmlURL:URLRequest = new URLRequest ("myXMLDoc.xml");
    var xmlLoader:URLLoader = new URLLoader (xmlURL);
    xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
    xmlLoader.addEventListener (IOErrorEvent.IO_ERROR, xmlLoadError);
    }

    function xmlLoaded(event:Event) {}
    XMLDATA = XML (event.target.data);
    trace(XMLDATA.art[0].@Name);
    trace ("data loaded successfully.");
    buildScreen();
    }

    function xmlLoadError(event:IOErrorEvent) {}
    trace (Event.Text);
    }

    function buildScreen() {}
    trace ("display building");
    var i: uint;
    for (i = 0; i < xmldata.art.length (); i ++) {}
    trace(XMLDATA.art
    .@Name);

    This next line is where I want to add my movieClips box01 and box02 on-screen *.
    and the use of x and y, the xml data placement *.

    var myMovieClip: [xmldata.art .@name] = new [xmldata.art.@name] ();
    myMovieClip.x = xmldata.art .@x.
    myMovieClip.y = xmldata.art
    .@y.
    addChild (myMovieClip);
    }
    }
    }
    }

    It's beautiful. Thank you!

  • How to analyze the data of 10 bytes encoded in the HH306 of Omegatte data logger/thermometer?

    I am trying to write a simple code for a HH306 of OMEGAETTE thermometer/travailleursduweb.com data recorder.

    That is the problem. I communicate with the device via RS - 232, using Labview 8.5.1 and windows xp. I ask her for "all the coded data", which is actually the only option. He returns 10 bytes of encoded data, the manual describes the meaning of each byte and I understand that. The problem is that I can't analyze the information for use in labview, for example: I want to extract the temperature and simply display it.

    on request, I get: 10bytes (read as a string from the serial port read buffer): display HEX: 02 00 A8 48 FF EF B6 49 B6 03 is perfect, and what I expect.     Display codes: \02\00\A8\B6H\FF\EF\B6I\03 The Normal display is a series of special characters, I don't understand, especially since I don't think they are ascii characters that must match returned hexadecimal numbers!   For the life of me, I can't understand how to extract the information (what are the 48 6 hexadecimal display) of what is returned. All string manipulation functions seem to work only on what is given in Normal view. (The 4th and 5th byte of the data are the codes of the BCD for temperature: for example the temperature was 64.8 degrees farenheight when I took this reading).

    Can someone help me to analyze the data returned by this device?

    Ok... I think that I thought about it. I found this: http://digital.ni.com/public.nsf/websearch/77C8F61D36F5A23086256634005ACB38?OpenDocument.

    I guess the normal display garbled is corresponding to each hexadecimal ascii characters. I'm just not used to seeing characters beyond the decimal number 127 ascii or hex 7F.

    So, basically, to analyze the 10 bytes of data:

    (1) break the string read from the serial port in the 10 ascii characters (using String subset vi)

    (2) son of each output string in the left input of 10 separate Type vi Cast.

    (3) wire a constant U8 in each terminal 'type' VI Type Cast.

    cables of 4) the chain of each Cast of Type vi output to the input of a number hexadecimal string vi.

    (5) concatenate or use as you wish as hexadecimal numbers (now in string format) which cause.

    See you soon.

  • How to analyze the data of the cDAQ and Signal Express, especially after analysis?

    In the first series of tests of my instrument, it took longer than expected for the race.  Thus, the data was saved in 6 days.  The file is too large for export to Excel.  At the beginning of the project, I was as ignorant as I could go ahead and add analysis and the scaling of measures.  By the scaling, I mean my data of switching current dew points or whatever it is that I record.

    How to evolve the data to read the output data as expected 4mA = point of dew of-20 C or 0 PSIG?  Can I pre program this to be recognized for each event?

    For real analysis I am doing – I would first analyze the data I recorded and choose different points to send to Excel to graph and analyze.  Is this possible?

    Secondly, I would like to know how to scale and analyze my data in the project without having to do this later analysis in the future?

    I have a cDAQ-9172 with LabVIEW signal Express 3.0 that uses four modules - 9211 2 modules of thermocouple, my 4-20 1-9201 module +/-10V module and 1-9203.

    Thank you for any assistance.

    Hi Patricia,

    "' You can do this by adding a step Load/Save signals ' analog '.  I hope this helps!

  • Web Service SOAP returned XML data are unreadable

    Hello

    I hope someone with some experience of SOAP could help me find a solution for which XML data coming out of a Web Service (SAP production) are illegible.

    In the attached file is the Web Service response, and as you can see in the header of the request is OK. (request to pass a serialized PCB of a 'tail' to 'work'). Request is successful (I manually check by directly connecting the SAP web service and check), but also the data on the printed circuit should be returned (edge stock code, etc...).

    My request and response with the XML data returned works very well in SoapUI.

    Any help would be appreciated.

    Darin.K wrote:

    I agree with Phillip (except that you want to "inflate" the payload).  You can simply post a VI with full response defined as default in a string control/indicator and I am betting we could get it sorted.

    Thanks Darin, I think acompress and after reading an article google re: SAP NetWeaver, who used the terms inflate and deflate, I confused my prefixes. I also regularly exchange numbers when transcribing the long numbers. Dyslexic, I am.

    JonnyR - please use the uncompress function I've included on the same link as soon as possible. You will need to remove the header HTML of the string portion. If you do not, unzip it will interpret the header as compressed data and you will get jumbled as output data.

  • 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

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

  • Select the XML data

    Dear all,

    Please find a list of the steps done to read the date of conversion of currency by the last final query, that I can be able to obtain the release of the name of the Bank as the Central Bank, but impossible to extract the time, rates, currency of the XML data.

    Please tell us how to solve the problem.

    CREATE TABLE url_tab

    (

    URL_NAME VARCHAR2 (100),

    SYS URL. URIType

    );

    INSERT INTO url_tab VALUES

    ("This is a test URL',

    sys . UriFactory.getUri ("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" "")

    );

    INSERT into xml_data_tab select sys.xmltype.createXML (u.url.getClob ()) in u url_tab;

    Select Bank_name, xt1.* from

    XMLTable (XMLNamespaces (default 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref', ))

                                   ' ( http://www.GESMES.org/XML/2002-08-01 ' as "gesmes"),

    ' / / gesmes:Envelope'

    FROM (select * from xml_data_tab)

    columns

    Path of varchar2 (100) Bank_name ' / gesmes:Envelope / gesmes:Sender / gesmes:name',

    outer join left perv_t XMLTYPE PATH "Cube/Cube")

    XMLTable (XMLNamespaces ('http://www.gesmes.org/xml/2002-08-01' as "gesmes"), )

    "/ / Cube/Cube."

    FROM (select * from xml_data_tab)

    COLUMNS

    path of varchar2 (100) of rate_date "@time"

    path varchar2 (100) coin "@currency."

    path of rate varchar2 (100) '@rate') xt1 on 1 = 1

    its work for me

    SQL > with xml_data_tab like)

    2. Select XMLType)

    3'http://www.gesmes.org/xml/2002-08-01' xmlns ="http://www.ecb.int/vocabulary/2002-08-01/eurofxref" >. "

    4 reference rate

    5

    6 the European Central Bank

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    28

    29

    30

    31

    32

    33

    34

    35

    36

    37

    38

    39

    40

    41

    42

    43 ') as the double DATA

    44)

    45 select Bank_name, xt1. RATE_DATE, xt2.*

    XMLTable 46 (XMLNamespaces (default 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref',

    47'http://www.gesmes.org/xml/2002-08-01"as"gesmes"),"

    48 ' / / gesmes:Envelope'

    49 FROM (select * from xml_data_tab)

    50 columns

    51 way of varchar2 (100) of Bank_name ' / gesmes:Envelope / gesmes:Sender / gesmes:name',

    52 perv_t XMLTYPE PATH 'Cube'):

    53 left outer join XMLTable (XMLNamespaces (default 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref'),

    54                         '*'

    55 in PASSING (h.perv_t)

    56 COLUMNS

    path of varchar2 (100) 57 rate_date "Cube/@time."

    58 rate_data XMLType path ' / / Cube/Cube ') xt1 on 1 = 1

    59 left outer join XMLTable (XMLNamespaces (default 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref'),

    60 ' / / cube/Cube/Cube. "

    61 FROM (select * from xml_data_tab)

    62 COLUMNS

    path of VARCHAR2 (3) currency 63 "@currency."

    number 64 path "@rate" rate) xt2 on 1 = 1;

    BANK_NAME RATE_DATE HEART RATE

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

    2015 Central Bank European-12-30 US $ 1.0926

    30-12-2015 of the European Central Bank JPY 131.66

    2015 Central Bank European-12-30 BGN 1.9558

    2015 Central Bank European-12-30 CZK 27.029

    30-12-2015 of the European Central Bank DKK 7.4625

    2015 Central Bank European-12-30 GBP.73799

    30-12-2015 of the European Central Bank HUF 313,15

    2015 Central Bank European-12-30 PLN 4.24

    30-12-2015 of the European Central Bank, RON 4.5296

    2015 Central Bank European-12-30 SEK 9.1878

    2015 Central Bank European-12-30 CHF 1.0814

    BANK_NAME RATE_DATE HEART RATE

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

    2015 Central Bank European-12-30 NOK 9.616

    30-12-2015 of the European Central Bank 7.637 HRK

    30-12-2015 of the European Central Bank RUB 79.754

    30-12-2015 of the European Central Bank TRY 3.1837

    2015 Central Bank European-12-30 AUD 1.499

    30-12-2015 of the European Central Bank BRL 4.259

    2015 Central Bank European-12-30 CAD 1.5171

    2015 Central Bank European-12-30 CNY 7.091

    2015 Central Bank European-12-30 HKD 8.4685

    30-12-2015 of the European Central Bank IDR 15081.33

    30-12-2015 of the European Central Bank, ILS 4.2606

    BANK_NAME RATE_DATE HEART RATE

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

    30-12-2015 of the European Central Bank INR 72.535

    30-12-2015 of the European Central Bank 1284.79 KRW

    2015 Central Bank European-12-30. 18.8867 MXN

    30-12-2015 of the European Central Bank MYR 4.6887

    2015 Central Bank European-12-30 NZD 1.5959

    30-12-2015 of the European Central Bank PHP 51.281

    30-12-2015 of the European Central Bank SGD 1.5449

    2015 Central Bank European-12-30 THB 39.334

    30-12-2015 of the European Central Bank ZAR 16.8847

    31 selected lines.

  • The value of XML data

    Hi all

    I am Oracle 11 g

    I have XML data as below

    < lines >

    < line-diff op = 'delete' line-stat = "oos" >

    < host rank = "targ" >

    < name of col = 'GUID' val = "7932504" / >

    < name of col = 'SCRTY_ROLE_ID' val = '1' / >

    < name of col = hex "GGROWHASH" = "o" val = 'ffffffffffffffff' / >

    < / row >

    < / line-diff >

    < line-diff op = 'delete' line-stat = "oos" >

    < host rank = "targ" >

    < name of col = 'GUID' val = "7933046" / >

    < name of col = 'SCRTY_ROLE_ID' val = '1' / >

    < name of col = hex "GGROWHASH" = "o" val = 'ffffffffffffffff' / >

    < / row >

    < / rows >

    Need to extract value and show as below

    OPERATION GUID SCRTY_ROLE_ID

    Remove 7932504 1

    Remove 7933046 1

    Please help on this.

    Appreciate your help.

    Thank you

    We can somewhat simplify the XQuery for @Gaz in Oz:

    WITH data(text) AS
    (SELECT
            '
                
                   
                      
                      
                      
                   
                
                
                   
                      
                      
                      
                   
                
                
                   
                      
                      
                      
                   
                
         '
    FROM dual
    )
    SELECT r.*
       FROM data x,
            XMLTABLE('rows/row-diff'
                    PASSING XMLTYPE(x.text)
                    COLUMNS operation     VARCHAR2(12) PATH '@op',
                            guid          NUMBER       PATH 'row/col[@name="GUID"]/@val',
                            scrty_role_id NUMBER       PATH 'row/col[@name="SCRTY_ROLE_ID"]/@val'
                   ) r
    ;
    
    OPERATION GUID SCRTY_ROLE_ID

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

    delete 7932504 1
    delete 7933046 1
    Update 7933999 1

    3 selected lines.

  • The ODI API method to test the connection to the server XML-Data

    Hello

    I tried my hands on ODI SDK API and could create the physics/logic connections through it successfully.

    At the studio of ODI, for XML technology, when test us the data server-> JDBC-> connection test connection, corresponding to the xml specified in the JDBC url schema (xsd) the lorsque nous tester la connexion de données serveur-> JDBC-> tester la connexion, correspondant à la schema (xsd) xml spécifié dans l' url JDBC les tables tables are created.

    But I'm not able to get this functionality with the API in the SDK. It seems that JDBC connection is not tested when the code below is run

    connection settings

    myDataServer.setConnectionSettings (new OdiDataServer.JdbcSettings)

    "jdbc:snps:xml? d = C: / my_sample_xsd.xsd & s = ITEST..." »)) ;

    So basically I want to imitate the "Test Connection" feature using the API of the SDK. Currently, it creates Server XML data and physical schema but no tables in the database.

    Pointers?

    Thank you.

    I found the solution...

    test the connection to the jdbc url

    RemoteRuntimeAgentInvoker remoteRuntimeAgentInvoker = new RemoteRuntimeAgentInvoker (": http://application-tier server: port/odiagentname", "odiuser", "odipassword".toCharArray ());

    try {}

    remoteRuntimeAgentInvoker.invokeTestDataServer (myDataServer.getDataServerId ());

    } catch (InvocationException e) {}

    e.printStackTrace ();

    }

Maybe you are looking for