Extract XML question

Hello

I have the XML code below in a table (configbom) that has a column (DATA) that is XMLTYPE. I try to extract the value of State via SQL in SQLPLUS like this:


SQL > Select extract(data,'/ConfigBomRequestResponse/ConfigBomRequestResult/StatusCode') from configbom;

EXTRACT(DATA,'/CONFIGBOMREQUESTRESPONSE/CONFIGBOMREQUESTRESULT/STATUSCODE')
--------------------------------------------------------------------------------


SQL >

I didn't recover. Does anyone have any ideas what I am doing wrong?

Thank you
Melinda



< ConfigBomRequestResponse xmlns = "http://swagelok.com/service/tibco/2009/09/03" >
< ConfigBomRequestResult xmlns:i = "http://www.w3.org/2001/XMLSchema-instance" >

< StatusCode > 0 < / StatusCode >
< StatusMessage / >
< BomResults >

< ConfigBomData >
< allocation_length i: nil = "true" / >
< cut_length
i: Nil = "true" / >
< description > FL UNDER ASSEMBLY < / description >

< part_number > SS-FL4B-C-RF4SA < / part_number >

< quantity_per > 2 < / quantity_per >
< i: Nile uom = "true" / >

< / ConfigBomData >
< ConfigBomData >

< allocation_length > 33,84 < / allocation_length >

< cut_length > 33,84 < / cut_length >
< description > 1 / 4 & quot; TUBE & amp;
BRAID < / description >
< part_number > SS-FL4-B-HXX < / part_number >

< quantity_per i: nil = "true" / >
IN < Glu > < / UDM >
< / ConfigBomData >

< / BomResults >
< / ConfigBomRequestResult >
< / ConfigBomRequestResponse >

Hi, Melinda,

two things: first of all, you can set the column in the table by using a table alias. This is necessary because the column is a type of object-orientation that should be treated by a Manager.
Then, you must pass in the namespace of the element. In otherwise, extract tent to search in the default namespace contains all values at all. As a result, your query should look like this:


select extract(x.data,
'/ConfigBomRequestResponse/ConfigBomRequestResult/StatusCode',
'xmlns="http://swagelok.com/service/tibco/2009/09/03"')
from configbom x;

Best regards

Jürgen

Tags: Database

Similar Questions

  • Several files extracted Xml name

    Hi, I make a change in our DMS project that has the input XML to extract file.

    We used this guideline for configuring a flat file with all entry names XMLs.

    https://support.Oracle.com/CSP/main/article?cmd=show & type = not & DOCTYPE = HOWTO & ID = 871446.1

    the configuration works perfectly. Our flat file list of files and reads them OK.

    My question comes here, how can I get the NAME of THE XML FILE which is extracted at the present time? I can get the input file, but it's the flat file that contains all the names, not the XML itself.

    Hi Andres,

    I see two options off the top of my head:
    (1) includes the name of the XML file in the XML - I know, it's a simple solution, but sometimes they are the best :)
    (2) map the name to extract XML in a GVM - I'm not exactly sure that this would work, but it might be possible. I'll see if I can find.

    -Andy

  • Extracting XML error. The XML file that is assigned in the configuration.xml is either incorrect or damaged.

    1. some web pages gives "error extracting XML. The XML file that is assigned in the configuration.xml is wrong or corrupt.

    2 Youtube gives, after having pressed the button start, message "an error has occurred. Please try again later.
    Even youtube opening page with IE, there is no problem.

    3. scrolling on Mozilla firefox pages only works with the sidebar not with the mouse wheel.

    Other user accounts on this computer is not these problems.

    BR Juha

    This can be caused by a recent update of Flash 11.3.

    See:

  • 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> 
    
  • Extract xml nested with attributes using plsql

    Hi, I need to extract xml file and insert 2 oracle tables. The xml file is the use of attributes, and I cannot retrieve the element 'code' nested with its attributes in the context of its parent folder "table." Here is a sample of the xml data that I have to extract the date:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < dataset - cv:dataset - cv dateProduced = "2011-09-19 11:50:45 ' xmlns:dataset - cv ="http://www.myurl.com/dataset-cv/1.0.0">"
    < lov >
    < id of the table = "00000000000001000" Name = "Role of the system" isSystem = "true" status = "Enabled" >
    < id code = "00000000000000306" Name = "Helpdesk" code = "1" status = "Enabled" / >
    < id code = "000000000000000307" Name = "Reviewer" code = "2" status = "Enabled" / >
    < id code = "00000000000000308" Name = 'Administrator' code = '3' status = "Enabled" / >
    < /table >
    < id of the table = "00000000000002000" Name = 'Country' sSystem 'false' status = "Enabled" = >
    < id code = "000000000000002004" Name = "AFGHANISTAN" code = "4" status = "Enabled" / >
    < id code = "000000000000002008" Name = 'ALBANIA' code = '8' status = "Enabled" / >
    < id code = "000000000000002010" Name = "ANTARCTICA" code = "10" status = "Enabled" / >
    < /table >
    < / lov >
    < / dataset - cv:dataset - cv >


    I use a query like this that seems to work to get all the attributes of table or all attributes of code element element, but not the code attributes in the context of his record from the table parent.

    SELECT id
    englishname
    status
    FROM XMLTABLE ('for $i //lov//table return $i"
    FROM db_get_xml_from_file (p_file_name, p_directory)
    ID VARCHAR2 COLUMNS (32) PATH '@id '.
    , englishname PATH VARCHAR2 (50) '@englishName '.
    , status VARCHAR2 (10) PATH '@status '.
    )

    Any help will be much appreciated

    Thank you

    Dave

    user12036327 wrote:
    I use a query like this that seems to work to get all the attributes of table or all attributes of code element element, but not the code attributes in the context of his record from the table parent.

    To get the nested data, that you need to implement nested xmltable statements. for example

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select xmltype('
      2  
      3    
      4      
      5        
      6        
      7        
      8      
    9 10 11 12 13
    14
    15
    ') as xml from dual) 16 -- 17 -- end of sample data 18 -- 19 select tbl.id tbl_id 20 ,tbl.englishname as tbl_englishname 21 ,tbl.issystem as tbl_issystem 22 ,tbl.status as tbl_status 23 ,cd.id as cd_id 24 ,cd.englishname as cd_englishname 25 ,cd.code as cd_code 26 ,cd.status as cd_status 27 from t 28 ,xmltable(xmlnamespaces('http://www.myurl.com/dataset-cv/1.0.0' as "dataset-cv"), 29 '/dataset-cv:dataset-cv/lov/table' 30 passing t.xml 31 columns id varchar2(32) path '/table/@id' 32 ,englishname varchar2(20) path '/table/@englishName' 33 ,issystem varchar2(5) path '/table/@isSystem' 34 ,status varchar2(10) path '/table/@status' 35 ,code xmltype path '.' 36 ) tbl 37 ,xmltable(xmlnamespaces('http://www.myurl.com/dataset-cv/1.0.0' as "dataset-cv"), 38 '/table/code' 39 passing tbl.code 40 columns id varchar2(32) path '/code/@id' 41 ,englishname varchar2(20) path '/code/@englishName' 42 ,code number path '/code/@code' 43 ,status varchar2(10) path '/code/@status' 44* ) cd SQL> / TBL_ID TBL_ENGLISHNAME TBL_I TBL_STATUS CD_ID CD_ENGLISHNAME CD_CODE CD_STATUS -------------------------------- -------------------- ----- ---------- -------------------------------- -------------------- ---------- ---------- 00000000000001000 System Role true Enabled 00000000000000306 Helpdesk 1 Enabled 00000000000001000 System Role true Enabled 000000000000000307 Reviewer 2 Enabled 00000000000001000 System Role true Enabled 00000000000000308 Administrator 3 Enabled 00000000000002000 Country false Enabled 000000000000002004 AFGHANISTAN 4 Enabled 00000000000002000 Country false Enabled 000000000000002008 ALBANIA 8 Enabled 00000000000002000 Country false Enabled 000000000000002010 ANTARCTICA 10 Enabled 6 rows selected.
  • Extracting XML data limit?

    Hi all

    Can someone help with the data limit for retrieving XML from a text field?

    Scenario: I have a text field with the limit set for the 1000 characters. Can you please let me know if there is any limitation extracting XML with a text field with 1000 characters?


    Thank you
    Yassine

    Hi John,

    I have not met a deadline, I had 8000-character text fields (as much as can fit on an A4 page) and I had pictures of 4 MB in a data node.

    Concerning

    Bruce

  • Extract XML with xmlns duble truble, 9i database data

    Hello

    I have a problem extracting the data from the example:

    My xml file:
    <? XML version = "1.0" encoding = "UTF-8"? >
    < document xmlns = "http://www.crea.si/Schemas/2004/Document/ZbsXml" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://www.crea.si/Schemas/2004/Document/ZbsXml ZbsCreaDoc.xsd" >
    < data >
    < DataFormat >
    text/xml, < MimeType > < / MimeType >
    < / DataFormat >
    < content >
    < EmbeddedData >
    < Paket xmlns = "http://www.zbs-giz.si/Schemas/2006/ZbsXml" >
    < VodilniZapis >
    < StevilkaRacuna > 00000000 < / StevilkaRacuna >
    < StevilkaPaketa > 0000 < / StevilkaPaketa >
    < DatumPaketa > 0000 - 00 - 00 < / DatumPaketa >
    < / VodilniZapis >
    < / Paket >
    < / EmbeddedData >
    < / content >
    < / data >
    < / document >

    my selection:
    SELECT extractValue (Value (t), ' VodilniZapis/StevilkaPaketa', 'xmlns = "http://www.crea.si/Schemas/2004/Document/ZbsXml" ') MimeType
    TABLE (XMLSequence (extract (xm, ' / Document/data/content/EmbeddedData/package/VodilniZapis ',' xmlns = "http://www.crea.si/Schemas/2004/Document/ZbsXml" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" '))) t;

    It does not work except that it I use only one < package > instead of < Paket xmlns = "http://www.zbs-giz.si/Schemas/2006/ZbsXml" >


    Anyopne help me? Thank you.

    Hello

    Since the element child "Paket" comes from another namespace, you must qualify (and its descendants) in the XPath expression.

    Something like this should do it:

    SELECT extractValue(value(t), 'VodilniZapis/StevilkaPaketa', 'xmlns="http://www.zbs-giz.si/Schemas/2006/ZbsXml"') mimetype
    FROM TABLE(
      XMLSequence(
        extract( xml, '/Document/Data/Content/EmbeddedData/ns2:Paket/ns2:VodilniZapis',
                 'xmlns="http://www.crea.si/Schemas/2004/Document/ZbsXml",
                  xmlns:ns2="http://www.zbs-giz.si/Schemas/2006/ZbsXml"' )
      )
    ) t;
    
  • Extract XML - Namespace question

    Hello
    I try to extract a value from an xml element, but it does not work when I put the name space.
    The following XML code:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < nfeProc xmlns = "http://www.portalfiscal.inf.br/nfe" xmlns:ds = "http://www.w3.org/2000/09/xmldsig#" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" versão "1.10" = >
    < NFe xmlns = "http://www.portalfiscal.inf.br/nfe" >
    < infNFe Id = versão "1.10" = "NFe35100492754738007094550010000418641120612904" >
    < ide >
    < cUF > 35 < / cUF >
    < cNF > 112061290 < / cNF >
    < natOp > COMPRA PARA COMERCIALIZACAO DEVOLUCAO < / natOp >
    < indPag > 0 < / indPag >
    < mod > 55 < / mod >
    < set > 1 < / series >
    < naturist > 41864 < / naturist >
    < a half > 2010 - 04 - 26 < / half >
    < dSaiEnt > 2010 - 04 - 26 < / dSaiEnt >
    < tpNF > 1 < / tpNF >
    < cMunFG > 3548708 < / cMunFG >
    < tpImp > 1 < / tpImp >
    < tpEmis > 1 < / tpEmis >
    < VAC > 4 < / cDV >
    < tpAmb > 2 < / tpAmb >
    < finNFe > 1 < / finNFe >
    < procEmi > 0 < / procEmi >
    < verProc > 1.0 < / verProc >
    < / ide >
    < / infNFe >
    < / CHILD >
    < / nfeProc >


    But this XML file is a BLOB in a table that I converted to CLOB and after to XMLTYPE.
    And here is the SQL code that I am trying to run:

    Select extract (column_value,'cUF / text () ') AS 'XML ELEMENT.
    of (xmltype (blob_to_clob (fl_l.file_data)) select media_data_clob)
    of fnd_attached_documents fad_l
    fnd_documents_tl fdt_l
    fnd_lobs fl_l
    where fad_l.document_id = fdt_l.document_id
    and fdt_l.media_id = fl_l.file_id
    and fdt_l.language = 'PTB '.
    and fad_l.entity_name = 'NFe_iSupplier') myxml.
    table (xmlsequence (Extract (media_data_clob, '//cUF'))) t;


    Can someone help me?

    Thank you!

    Hello

    You must add a namespace clause the extract() function.

    table example (xmlsequence (extract (media_data_clob,'/ / EUC ',' xmlns = http://www.portalfiscal.inf.br/nfe')))

    HTH,

    Chris

  • Extract XML Value returns nothing

    Hi, I have a table where I put an XMLTYPE column called XML_RESPONSE and a CLOB called XML_RESPONSE_CLOB with the same XML content each.

    One of the values of records in the two columns look like this:

    <? xml version = "1.0" encoding = "UTF - 8"? >< s : Envelope xmlns:S = » http://schemas.xmlsoap.org/soap/envelope/ « >< Body >< ns2:StampCFDBytesResponse xmlns:ns2 = » http://impl.Controllers.massive.Fe.STO.com/ "xmlns:ns3 = » http://exception.Fe.STO.com/ "><stampedDocument>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGNmZGk6Q29tcHJvYmFudGUgdmVyc2lvbj0iMy4yIiBmb2xpbz0Cinb2IubXgvVGltYnJlRmlzY2FsRGlnaXRhbCBodHRwOi8vd3d3LnNhdC5nb2IubXgvVGltYnJlRmlzY2FsRGlnaXRhbC9UaW1icmVGaXNjYWxEaWdpdGFsLnhzZCIgeG1sbnM6dGZkPSJodHRwOi8vd3d3LnNhdC5nb2IubXgvVGltYnJlRmlzY2FsRGlnaXRhbCIvPgogICAgPC9jZmRpOkNvbXBsZW1lbnRvPgo8L2NmZGk6Q29tcHJvYmFudGU+</stampedDocument></ns2:StampCFDBytesResponse></S:Body></S:Envelope>

    I am trying to extract the base64 code, that is inside the < stampedDocument > element.

    If I use this code, the procedure runs, but returns nothing:

    Select apex_web_service.parse_xml (XML_RESPONSE, "/ / envelope/body/stampedDocument")

    in v_stamped from f_cfdi_timbrados where id_cfdi_timbrado = 1002;

    If I use the following the procedure returns an error:

    Select apex_web_service.parse_xml (XML_RESPONSE, '//Envelope/Body/stampedDocument/stampedDocument ()')

    Select apex_web_service.parse_xml (XML_RESPONSE, '//S:Envelope/S:Body/stampedDocument/stampedDocument ()')

    Select apex_web_service.parse_xml (XML_RESPONSE, ' / / s: Envelope / Body / stampedDocument')

    in v_stamped from f_cfdi_timbrados where id_cfdi_timbrado = 1002;

    06503 00000 - "PL/SQL: function returned no value."

    * Cause: A call to the PL/SQL function completed, but no RETURN statement has been

    executed.

    * Action: Function to rewrite PL/SQL, ensuring that it always returns

    a value of the appropriate type.

    I also tried with the ExtractValue function and retunrs null or an error.

    SELECT id_cfdi_timbrado,

    EXTRACTVALUE (e.xml_response, ' / envelope/body/stampedDocument ')

    'CFDI_BASE_64 '.

    OF e f_cfdi_timbrados

    WHERE id_cfdi_timbrado = 1002;

    Please notify. It's my first experience of XML parsing and it seems that I am lost.

    Francisco

    The error message provides the clue that you need.  If you were to search on this error message, you will see he's trying to tell you that you are missing a RETURN statement at the end of your function.  Something like

    RETURN v_stamped;

    That would resolve the issue causing the error ORA.

    Regarding the second question, that you will encounter, your clips are not correctly name space which is part of the XML.  For extractValue, there is a third parm

    EXTRACTVALUE

    If your query would look like

    EXTRACTVALUE (e.xml_response, ' / s: Envelope/Body / ns2:stampedDocument ',' xmlns:S = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2 = "http://impl.controllers.massive.fe.sto.com/"')

    I leave you to you of apex_web_service.parse_xml of research

    That said, depending on your version of Oracle, extractValue might be obsolete and you will have to go in a different direction.

    Here are a few tips to post on the forums

    Re: 2. How can I ask a question in the forums?

  • Performance of XML question

    Hi all

    I have the query in order to retrieve the xml values in the table using XMLTABLE. The XMLTABLE extract about 280 columns. It takes 30 seconds to give the output. How to tune this XML query? or what is the best way.

    DB version:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    PL/SQL Release 11.2.0.1.0 - Production

    "CORE 11.2.0.1.0 Production."

    AMT for Linux: Version 11.2.0.1.0 - Production

    NLSRTL Version 11.2.0.1.0 - Production

    Query:

    SELECT OUTPUT.*

    OF AM_CUST_WS_MB t

    , XMLTABLE ('. t.CUSTXML PASSAGE des/ROOT/Types_of_Financials)

    COLUMNS

    PATH of VARCHAR2 (75) of Types_of_Financials '. / @VALUE',

    PATH of VARCHAR2 (75) of FY_Ended_DD_MM_YY '. / FY_Ended_DD_MM_YY/@VALUE',

    PATH of VARCHAR2 (75) of Operating_Months '. / FY_Ended_DD_MM_YY/Operating_Months/@VALUE',

    ..

    ..

    .. / * more than 200 columns described here * /.

    ..

    ..) OUTPUT

    Thank you

    Fame

    OK, this could be problematic:

    XMLTYPE COLUMN CUSTXML STORE AS CLOB BASICFILE

    You can recreate the table like this:

    create table am_cust_ws_mb)

    xmltype custxml

    )

    custxml XMLType column store as xml binary securefile;

    and test again?

  • Extract xml

    Hi all

    It comes to my table structure,

    create table xml_test (col1 XMLTYPE);

    It comes to my xml. I want to extract this file as xml below

    < ROOT >

    NASA < NAME_OF_THE_COMPANY > < / NAME_OF_THE_COMPANY >

    < DETAILED_DATA_ENTERED VALUE = 'test' >

    < TYPES_OF_FINANCIALS VALUE = "Checked" >

    < FY_ENDED_DD_MM_YY VALUE = 'Saturday, March 31, 2012' >

    < OPERATING_MONTHS VALUE = "12" >

    < PROFIT_AND_LOSS_STATEMENT VALUE = "" >

    < TOTAL_REVENUE VALUE = "6.00" >

    < REVENUE_FROM_OPERATIONS VALUE = "5.00" >

    < GROSS_DOMESTIC_REVENUE VALUE = "3.00" >

    < GROSS_REVENUE_MANUFACTURING > 1,00 < / GROSS_REVENUE_MANUFACTURING >

    < GROSS_REVENUE_SERVICES > 1,00 < / GROSS_REVENUE_SERVICES >

    < GROSS_REVENUE_TRADING > 1,00 < / GROSS_REVENUE_TRADING >

    < / GROSS_DOMESTIC_REVENUE >

    < GROSS_EXPORT_REVENUE VALUE = "3.00" >

    < GROSS_REVENUE_MANUFACTURING > 1,00 < / GROSS_REVENUE_MANUFACTURING >

    < GROSS_REVENUE_SERVICES > 1,00 < / GROSS_REVENUE_SERVICES >

    < GROSS_REVENUE_TRADING > 1,00 < / GROSS_REVENUE_TRADING >

    < / GROSS_EXPORT_REVENUE >

    < EXCISE_DUTY > 1,00 < / EXCISE_DUTY >

    < / REVENUE_FROM_OPERATIONS >

    < OTHER_OPERATING_INCOME > 1,00 < / OTHER_OPERATING_INCOME >

    < / TOTAL_REVENUE >

    < TOTAL_EXPENSES VALUE = "15.00" >

    < COST_OF_RAW_MATERIALS VALUE = "2.00" >

    < ANY > 1,00 < / IMPORTED >

    < Aboriginal PEOPLE > 1,00 < / Aboriginal PEOPLES >

    < / COST_OF_RAW_MATERIALS >

    < / TOTAL_EXPENSES >

    < / PROFIT_AND_LOSS_STATEMENT >

    < / OPERATING_MONTHS >

    < / FY_ENDED_DD_MM_YY >

    < / TYPES_OF_FINANCIALS >

    < / DETAILED_DATA_ENTERED >

    < / ROOT >

    power required,

    Nasa company name

    Detailed data entered test

    Types of financial statements audited

    Exercise took end (DD-MM-YY) Saturday 31 March 2012

    Operating 12 months

    Profit & loss

    Total revenues 6.00

    Revenue from operations 5.00

    Gross national income 3.00

    Gross revenue - manufacturing 1.00

    Gross income - Services 1.00

    Revenue - Trading 1.00 raw

    Gross export revenues 3.00

    Gross revenue - manufacturing 1.00

    Gross income - Services 1.00

    Revenue - Trading 1.00 raw

    Excise 1.00

    Another 1.00 operating income

    Total costs 15.00

    Cost of raw materials 2.00

    1,00 imported

    1.00 Aboriginal

    Thank you

    Fame

    I'm not well versed in XQUERY. But spent some time to understand helps to do the job. I would say the same for you.

    SQL> select x.*
      2    from xml_test t
      3       , xmltable
      4         (
      5         'for $i in /ROOT/ROW
      6            return
      7            (
      8                {$i/NAME_OF_THE_COMPANY}
      9              , for $j in $i/DETAILED_DATA_ENTERED
     10                return
     11                (
     12                      {data($j/@VALUE)}
     13                    , {data($j/TYPES_OF_FINANCIALS/@VALUE)}
     14                    , {data($j/TYPES_OF_FINANCIALS/FY_ENDED_DD_MM_YY/@VALUE)}
     15                )
     16            )'
     17          passing t.col1
     18          columns category_name  varchar2(30)   path '@name'
     19                , val            varchar2(4000) path '.'
     20         ) x  ;
    
    CATEGORY_NAME                  VAL
    ------------------------------ --------------------------------------------------
    Name of the Company            NASA
    Detailed Data Entered          test
    Types of Financials            Audited
    FY Ended (DD-MM-YY)            Saturday, March 31, 2012
    Detailed Data Entered          test1
    Types of Financials            Audited1
    FY Ended (DD-MM-YY)            Sunday, April 01, 2012
    Name of the Company            BHEL
    Detailed Data Entered          test
    Types of Financials            Audited
    FY Ended (DD-MM-YY)            Saturday, March 31, 2012
    Detailed Data Entered          test1
    Types of Financials            Audited1
    FY Ended (DD-MM-YY)            Sunday, April 01, 2012
    
    14 rows selected.
    
  • 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.

  • OFR Extraction Learnset questions

    Hello

    I'm working on a POC for CAO to extract the data from the scanned drawings. It is not related to AP, so I had to start from scratch with a lot of things.

    I worked in the Guide OFR-Designer, but I hit a few questions that stopped me in my tracks.

    Here's what I have:

    -J' created a Classification Learnset and RPO is now correctly classify images

    -My class structure looks like this:

    -Drawing.sdp

    -Drawing

    -Architecture

    -Engineering

    -Generic

    -Geographical

    -Map

    -Vacuum

    Currently, I am putting in place field extraction. I only get a few fields from the images.

    I put the 'Analysis' method for the fields to be "Format Analysis", by using a simple expression.

    When I work with different images by way of definition, I gives me appropriate candidates. I therefore assumed that I was ready to go to the training.

    Here are the problems I encounter:

    -When I go to Train Normal Mode and process the images in the Learnset Extraction that I put up, I get two questions:

    -The first document gets a candidate for the first field, but all following images don't get a candidate (even tho ' they do during treatment in Def mode).

    -In addition, my second field is grayed out and I can't select it.

    -If I try to use the Mode of Train of check, I get an error on the field of Classification for the generic class definition. Not sure I should use this, but I'll try anything at the moment.

    If you have suggestions or questions, I would really appreciate the input.

    See you soon,.

    A

    Hey

    I finally got around my problems, and I thought I want to be fed in the thread that I did to solve the problem.

    In fact, I had three questions:

    1. Firstly - I shouldn't have tried to use the training mode to check, because it's only for projects using SLW.

    2. the quality of the images that I used for the training of Extraction was not as high as it should have been. OFR was not able to read a text and therefore could not identify as candidates.

    3. most important - I had tried to use "Indicator to find" in the parameters of the analysis. I tried to find the string next to the 'author', so I had to "Indicator to find" and "Author", a Format string and ignore the ': '.

    It worked intermittently at best. I finally changed it to "Find the Format" with a format of ' @[2-100]. This marked all the readable text, and once I have trained a number of images (5 +) including the text to use, OFR can then identify the well field.

    .

    Kind regards

    A

  • Extract newbee question

    GG experts OK another question.

    If a first single is up and running on a system of production and the need arises to stop the extract, make a change and restart.  Database changes made during the period that the extract is stopped will be lost?  I guess they would be, and the databases are now out of sync.  If this is the case how do you work around that?  Is the only way to take a time out and prohibit data changes while the extract is stopped?

    Thanks in advance

    This is not true.

    When you restart extracted (power), it starts reading the old SNA where it was stopped/last control point. . This means that you do not lose the changes of database for the hour that extracted was arrested.  Only, you will notice a lag with extract when you start.

    I hope this helps.

  • How to extract xml with namespaces

    Hi all

    Here's the XML I:

    <? XML version = "1.0" encoding = "UTF-8"? >
    -< transaction xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns = "http://schemas.test.com/Support/Services/test1/2012" xsi: schemaLocation = "http://schemas.test.com/Support/Services/test1/2012 Support.test1.v1.xsd" >
    -< application >
    < > 10 Sam < / Sam >
    < > 32 Actid < / Actid >
    < Pax > 3 < / Pax >
    < > 10 - DEC - 2012 Flt < / Flt >
    < user name > WebUserNameTest < / name >
    < / request >
    < application >
    < Sam > 1 < / Sam >
    < Actid > 3 < / Actid >
    < > 2 Pax < / Pax >
    < Flt > 2012 - dec - 12 < / Flt >
    < user name > WebUserNameTest < / name >
    < / request >
    < / transaction >

    I need to extract the item values:

    The code below will help me when I have no namespace, what needs to be done in order to work with the value of the element namespace and etract

    v_string_xml: =.
    ' / / Query [' |] To_char (counter_xml) | '] / Sam / text () ';
    v_ssp_table (v_ssp_table. COUNTY) .memid: =.
    p_xml_in. EXTRACT (v_string_xml) .getnumberval ();

    v_string_xml: =.
    ' / / Query [' |] To_char (counter_xml) | '] / Actid / text () ';
    v_ssp_table (v_ssp_table. COUNTY) .actid: =.
    p_xml_in. EXTRACT (v_string_xml) .getnumberval ();

    v_string_xml: =.
    ' / / Query [']
    || To_char (counter_xml)
    || '] / Pax / text () ';
    v_ssp_table (v_ssp_table..) Pax COUNT): =.
    p_xml_in. EXTRACT (v_string_xml) .getnumberval ();

    v_string_xml: =.
    ' / / Query [' |] To_char (counter_xml) | '] / Flt / text () ';
    v_ssp_table (v_ssp_table..) Flt COUNT): =.
    p_xml_in. EXTRACT (v_string_xml) .getstringval ();

    v_string_xml: =.
    ' / / Query [']
    || To_char (counter_xml)
    || '] / Username / text () ';
    v_ssp_table (v_ssp_table. COUNTY) .username: =.
    p_xml_in. EXTRACT (v_string_xml) .getstringval ();

    Published by: akm006 on March 19, 2013 11:11

    Try

    SQL> declare
      2  x xmltype := xmltype('
      3  
      4  
      5  10
      6  32
      7  3
      8  2012-DEC-10
      9  WebUserNameTest
     10  
     11  
     12  1
     13  3
     14  2
     15  2012-DEC-12
     16  WebUserNameTest
     17  
     18  ') ;
     19
     20  v_string_xml varchar2(100);
     21  v_string_xml_ns varchar2(500);
     22  v_ssp number;
     23  counter_xml number := 1;
     24  begin
     25
     26  v_string_xml := 'Transaction/Request[' || TO_CHAR (counter_xml) || ']/Memid/text()';
     27
     28  v_string_xml_ns :='xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.test.com/Support/Services/test1/2012"';
     29
     30  v_ssp := x.EXTRACT(v_string_xml,v_string_xml_ns).getnumberval();
     31
     32  dbms_output.put_line(v_ssp);
     33
     34  end;
     35  /
    
    10
    
    PL/SQL procedure successfully completed
    
    SQL>
    

Maybe you are looking for