Loading the values of XML tag parent in the Oracle table and the values of the child

<project>
  
<id>001</id>
  
<name>Math Project</name>
  .
  .
  
<team>
  
<id>1</id>
  
<name> Team Roger </name>
  .
  .
  
</team>

  
</project>
  
<project>
  
<id>002</id>
  
<name>Science Project</name>
  .
  .
  
<team>
  
<id>2</id>
  
<name> Team Alpha </name>  .
  
</team>
  
<team>
  
<id>3</id>
  
<name>Team Romeo </id>

  
</project>

It's the structure of the XML where the content is changed daily and the file is placed in "D:\Test_Dir". I'm trying to load a table (teams) with the details of the team and its corresponding parent, like this project:

proj_id team_id team_name
001 1   Team Roger
002 2   Team Alpha
002 3   Team Romeo
Below is the pl/sql block I wrote:

declare
cursor proj_cur
is select project_id from projects;
proj_rec proj_cur
%rowtype;
begin
for proj_rec in proj_cur
loop
INSERT INTO teams
(team_id,team_name,project_id)
WITH t AS
(SELECT xmltype(bfilename('TEST_DIR','SCRUM.xml'), nls_charset_id('UTF8')) xmlcol FROM dual)
SELECT 
extractValue
(value(x),'*/id')team_id
,extractValue(value(x),'*/name') team_name
,extractValue(value(y),'/project/id') project_id
FROM t
,TABLE(XMLSequence(extract(t.xmlcol,'/scrumwise-export/data/account/projects/project'))) y
,TABLE(XMLSequence(extract(t.xmlcol,'/scrumwise-export/data/account/projects/project/people/teams/team'))) x
where (extractValue(value(y),'/project/id'))='emp_rec.project_id';
end loop;
end;


This returns a cartesian product! Any help with this is much appreciated.

A few additional tips BTW:

-do not use wildcards (*) when you really know the structure of the XML document and the name of the node you want to extract.

-use the UTF8 character set is not recommended because it supports any valid XML characters. Use rather AL32UTF8 .

So, similar to Kim:

select proj.project_id
     , team.team_id
     , team.team_name
from xmltable(
       '/scrumwise-export/data/account/projects/project'
       passing xmltype(bfilename('XML_DIR','SCRUM.xml'), nls_charset_id('AL32UTF8'))
       columns
         project_id  varchar2(3) path 'id'
       , teams       xmltype     path 'people/teams/team'
      ) proj
    , xmltable(
        '/team'
        passing proj.teams
        columns
          team_id     number         path 'id'
        , team_name   varchar2(100)  path 'name'
      ) team
where exists (
  select null
  from projects p
  where p.id = proj.project_id
) ;

Or a shorter version using a single XMLTABLE:

select team.project_id
     , team.team_id
     , team.team_name
from xmltable(
       'for $i in /scrumwise-export/data/account/projects/project
          , $j in $i/people/teams/team
        return element r {
          element project_id {$i/id}
        , $j/id
        , $j/name
        }'
       passing xmltype(bfilename('XML_DIR','SCRUM.xml'), nls_charset_id('AL32UTF8'))
       columns
         project_id  varchar2(3)    path 'project_id'
       , team_id     number         path 'id'
       , team_name   varchar2(100)  path 'name'
     ) team
where exists (
  select null
  from projects p
  where p.id = team.project_id
) ;

And if a project can have no team, you can the outer join the XMLTABLE 2nd instead:

    , xmltable(
        '/team'
        passing proj.teams
        columns
          team_id     number         path 'id'
        , team_name   varchar2(100)  path 'name'
      ) (+) team

Tags: Database

Similar Questions

  • How to load the child table by using a simple slider...?

    How can I loa the child table by using a PL/SQL block cursor...

    for example, I have a table of the source called method

    EmpNo, empname, deptid deptname

    and I have 2 tables of taget... EMP and Dept.

    EMP
    ===
    EmpNo, empname, deptid

    Dept
    ====
    deptID, deptname


    Here, I want to load method for emp data and... Dept where dept does not contain data in double...

    For now... I used the cursor and in the same cursor, I'm loading data first dept table and then to the emp table.
    I use for dept, exceptional setting, which will manage a PK constraint violation error by doing nothing...

    in this way, there will be no duplicates... but it is not advisable because I 15,00,000 lines in the method table.

    Is there another way to do it?

    OK, I'd probably go with the method two insert, but as an alternative, here's a way to do it in a single insert:

    create table emp_info as
    select 1 empno, 'a' empname, 101 deptid, 'aaa' deptname from dual union all
    select 2, 'b' empname, 201 deptid, 'bbb' deptname from dual union all
    select 3, 'c' empname, 101 deptid, 'aaa' deptname from dual union all
    select 4, 'd' empname, 101 deptid, 'aaa' deptname from dual union all
    select 5, 'e' empname, 301 deptid, 'ccc' deptname from dual;
    
    create table emp (empno number primary key, empname varchar2(3), deptid number);
    
    create table dept (deptid number primary key, deptname varchar2(3));
    
    insert all
      WHEN rn = 1 THEN
           into dept (deptid, deptname)
           values (deptid, deptname)
      WHEN rn > 0 THEN
           into emp (empno, empname, deptid)
           values (empno, empname, deptid)
    select empno, empname, deptid, deptname, rn
    from   (select empno,
                   empname,
                   deptid,
                   deptname,
                   row_number() over (partition by deptid order by empno) rn
            from   emp_info);
    
      8 rows inserted
    
    commit;
    
    select * from emp;
    
         EMPNO EMP     DEPTID
    ---------- --- ----------
             1 a          101
             3 c          101
             4 d          101
             2 b          201
             5 e          301
    
    select * from dept;
    
        DEPTID DEP
    ---------- ---
           101 aaa
           201 bbb
           301 ccc
    

    You must test these two methods to see which is more efficient.

  • Change the xml tag when generating a mapping table it

    Hello

    I have to generate a xml that involves two tables

    (1) STORE_CFA_EXT

    (2) CFA_ATTRIB

    But the problem is that the name of column in STORE_CFA_EXT is stored in CFA_ATTRIB as values of column.

    insert into STORE_CFA_EXT (STORE, GROUP_ID, VARCHAR2_1, VARCHAR2_2)

    values (114, 123, "MIDWE', 'Y');

    insert into STORE_CFA_EXT (STORE, GROUP_ID, VARCHAR2_1, VARCHAR2_2)

    values (114, 124, 'Y', ");

    insert into cfa_attrib (GROUP_ID, VIEW_COL_NAME, ATTRIB_ID, STORAGE_COL_NAME)

    values (213, 123, 'STR_NM_5_ABBR', 'VARCHAR2_1');

    insert into CFA_ATTRIB (GROUP_ID, VIEW_COL_NAME, ATTRIB_ID, STORAGE_COL_NAME)

    values (214, 123, 'DST_IND', 'VARCHAR2_2');

    insert into cfa_attrib (GROUP_ID, VIEW_COL_NAME, ATTRIB_ID, STORAGE_COL_NAME)

    values (225, 124, 'SLS_INCL_DTE_CDE', 'VARCHAR2_1');

    query used

    {code}

    Select

    XmlElement ("CFA",

    XMLFOREST (store,

    group_id,

    varchar2_1

    )

    )

    of store_cfa_ext

    where to store = 114

    and group_id = 123;

    result:

    < CFAS >

    < STORE > 114 < / STORE >

    < > 123 GROUP_ID < / GROUP_ID >

    < VARCHAR2_1 > MIDWE < / VARCHAR2_1 >

    < / CFAS >

    expected result:

    < CFAS >

    < STORE > 114 < / STORE >

    < > 123 GROUP_ID < / GROUP_ID >

    < STR_NM_5_ABBR > MIDWE < / STR_NM_5_ABBR >

    < / CFAS >

    When generating the xml file so I need to <VARCHAR2_1 > STORE_CFA_EXT table column name with the corresponding value in table i CFA_ATTRIB, e STR_NM_5_ABBR. I can't use cases or decode the tables involved have other columns with the same problem. Could someone help me please with the question. I tried several options but have not found an effective solution

    Thank you

    Hello

    The key is to use the auxiliary function EVALNAME(), which allows to build the name of the tag of an expression.

    Here is an example of the use of an intermediate PIVOT operation to retrieve the names of targets on the same line:

    SQL> select xmlserialize(document
      2           xmlelement("cfas"
      3           , xmlforest(
      4               store
      5             , group_id
      6             , varchar2_1 as evalname(varchar2_1_name)
      7             , varchar2_2 as evalname(varchar2_2_name)
      8             )
      9           )
     10           indent
     11         )
     12  from (
     13    select s.store
     14         , s.group_id
     15         , s.varchar2_1
     16         , s.varchar2_2
     17         , a.view_col_name
     18         , a.storage_col_name
     19    from store_cfa_ext s
     20         join cfa_attrib a on a.group_id = s.group_id
     21    where s.store = 114
     22    and s.group_id = 123
     23  )
     24  pivot (
     25    min(view_col_name)
     26    for storage_col_name in (
     27      'VARCHAR2_1' as varchar2_1_name
     28    , 'VARCHAR2_2' as varchar2_2_name
     29    )
     30  ) ;
    
    XMLSERIALIZE(DOCUMENTXMLELEMEN
    --------------------------------------------------------------------------------
    
      114
      123
      MIDWE
      Y
    
    
  • Help remove XML tags

    Here's the actionscript and XML sample that works very well except all my XML tags appear in dynamic text fields and the images are not load because it cannot find < image > images/this.jpg < / image >

    Any assistance will be rewarded in the life after.



    I found the answer. Missed me the reference at the end of each call firstChild.
    myText.text = xmlDoc_xml.firstChild.childNodes [n].firstChild.firstChild;
    btQ.loc.text = xmlDoc_xml.firstChild.childNodes [n].firstChild.nextSibling.firstChild;
    btQ.myLoader.load (xmlDoc_xml.firstChild.childNodes [n]. firstChild.nextSibling.nextSibling. firstChild);

  • Call a method bean after loading the page in the file jsff

    Hi all

    I'm working on JDeveloper 11.1.1.7.0.

    I need to call a managed bean method after jsff is responsible. My requirement is that I must add dynamically RichImage on my page. So I put a PanelGroupLayout as a container on the page. I add the RichImages to this PanelGroupLayout with

    parentUIComponent.getChildren () .add (childUIComponent);

    I tried using regionController but it gives me as regionController Null pointer has no access to user interface components on the page.

    then I tried with javascript, but it is not shooting my bean method managed. I put the code below in my home.jspx

    < af:document id = "d1" >

    < af:serverListener type = "onloadEvent" method="#{viewScope.ConnPocBean.initMethod}"/ >

    < af:resource type = "javascript" >

    function onLoadClient (event) {}

    AdfCustomEvent.queue (event.getSource (), "onloadEvent", {}, false);

    Returns true;

    }

    < / af:resource >

    and below is the code in my testPage.jsff file

    < af:clientListener method = "onLoadClient" type = "load" / >

    But here, when loading my testPage.jsff... initMethod() is not going to get fired.

    Please let me know what is the problem here.

    Thank you

    Fox

    If you want to try other ways to add a child element to PanelGroupLayout, use:

    parentUIComponent.getChildren () .add (childUIComponent);

    AdfFacesContext.getCurrentInstance () .addPartialTarget (parentUIComponent);

    in the Get accessor of the binding of an element method, which is placed after PanelGroupLayout in your jsff. So when the next component is loaded the child will be added to the PanelGroupLayout

  • generate the xml to oracle table

    Hello

    I want to generate xml form an oracle table and using the sql express oracle developer 10 g, forler xdk is decompressed also under folder oracle express, still getting the following error: code used
    var g_clob clob;
    
     declare
         l_ctx  dbms_xmlquery.ctxHandle;
         l_clob clob;
        begin
          l_ctx := dbms_xmlquery.newContext('select * from scott.emp');
          dbms_lob.createtemporary(:g_clob,true,dbms_lob.session);
          :g_clob := dbms_xmlquery.getXml(l_ctx);
        end;
        /
    ORA-06550: line 2, column 14:
    PLS-00201: identifier ' DBMS_XMLQUERY. CTXHANDLE' must be declared

    Thanks in advance

    Hello

    DBMS_XMLQUERY is a wrapper for the methods in the Java class "oracle.xml.sql.query.OracleXMLStaticQuery".
    The problem is that Oracle 10 g XE is not a JAVA virtual machine, you can not use this package.

    Use DBMS_XMLGEN instead, it provides similar functionality and is more effective (C-based):

    SQL> var g_clob clob
    SQL> DECLARE
      2    l_ctx    dbms_xmlgen.ctxHandle;
      3  BEGIN
      4    l_ctx := dbms_xmlgen.newContext('select * from scott.emp');
      5    :g_clob := dbms_xmlgen.getXML(l_ctx);
      6    dbms_xmlgen.closeContext(l_ctx);
      7  END;
      8  /
    
    PL/SQL procedure successfully completed.
    
    SQL> set long 5000
    SQL> set pages 1000
    SQL> print g_clob
    
    G_CLOB
    --------------------------------------------------------------------------------
    
    
     
      7369
      SMITH
      CLERK
      7902
      17/12/80
      800
      20
     
     
      7499
      ALLEN
      SALESMAN
      7698
      20/02/81
      1600
      300
      30
     
     
      7521
      WARD
      SALESMAN
      7698
      22/02/81
      1250
      500
      30
     
     
      7566
      JONES
      MANAGER
      7839
      02/04/81
      2975
      20
     
     
      7654
      MARTIN
      SALESMAN
      7698
      28/09/81
      1250
      1400
      30
     
     
      7698
      BLAKE
      MANAGER
      7839
      01/05/81
      2850
      30
     
     
      7782
      CLARK
      MANAGER
      7839
      09/06/81
      2450
      10
     
     
      7839
      KING
      PRESIDENT
      17/11/81
      5000
      10
     
     
      7844
      TURNER
      SALESMAN
      7698
      08/09/81
      1500
      0
      30
     
     
      7900
      JAMES
      CLERK
      7698
      03/12/81
      950
      30
     
     
      7902
      FORD
      ANALYST
      7566
      03/12/81
      3000
      20
     
     
      7934
      MILLER
      CLERK
      7782
      23/01/82
      1300
      10
     
    
    

    Or, using the SQL/XML functions:

    SELECT XMLElement("ROWSET",
             XMLAgg(
               XMLElement("ROW",
                 XMLForest(empno, ename, job, mgr, hiredate, sal, comm, deptno)
               )
             )
           ).getClobVal()
    FROM scott.emp
    ;
    
  • MouseEvent.CLICK blocked by the child bitmap problem

    Hey guys.

    If anyone has experienced this problem or is sufficiently educated so that you can come up with a working solution then please post here.

    Good so for now I have 2 SWF files. A swf is the main swf, which contains a class called Avatar. This class extends Sprite and has 1 child, which is a bitmap image.

    What I do is load the child swf file into the main swf, create an object of the Avatar class and pass the Avatar object down to the child swf file.

    The child swf file takes this object and adds it to a Sprite object as one of its children. Then I add an event listener for MouseEvent.CLICK to Sprite (the one containing the Avatar sprite) object that is in the child swf file.

    Now when I click on the Avatar inside the Sprite image in the child swf file. Do not fire the mouse click event.


    If you can shed some light as to why this happens, I would be very grateful.

    Thank you.

    Difficult to say without seeing a code.

    As you describe it - it should work. How do you know that MOUSE_CLICK is not pulled?

    In addition, there are masks?

  • Only one Integrator for export csv to table and update the table?

    Hello
    I have a requirement where I need to create a single Integrator for export data in the CSV file into a custom oracle table and also use the same Integrator to download and update the custom table data. Is it possible to do this in a single Integrator.

    Thank you
    Kishore

    Yes you can do it.

    You must create a type of UPDATE metadata Integrator.

    First time:

    Custom table is empty.

    WEB ADI will download a blank Excel sheet. Copy the data from the CSV file and paste this Excel.Then download this file that will update the Integrator.

    A sample example is as follows:

    web_adi_pkg.main (param_1, param_2,... param_n)
    download_data;
    upload_data;

    Download data-> select query to download the data (select * from custom_table)
    Download the data-> insert into custom_table where NOT EXISTS (select 1 from custom_table where primary_key = primary_key_col_from_csv)
    update of custom_table where there are (select 1 from custom_table where primary_key = primary_key_col_from_csv)

    Please try above logic.

  • What is the easiest way to read a value of XML tag

    Hi all

    Im not at all experienced in the use of the XML parser library.

    How can I retrieve the value of the label?
    I use the matching node get all (see attachment). Get XML gives me:

    ABDELKADER<p class="help"> <p class="help">How can I retrieve the value of the tag (AAAA), without the XML tags directly?</p> <p class="help">Thank you all</p> <p class="reply">You can use the get node text Content.vi of the same range as the other function XML you use.</p> <p class="reply">From a node property uses the "node value".</p>

  • Extract the value between the xml tags in the XML inside the BLOB field

    Hello

    I have a table that contains a BLOB column, this XML file to store column that received from an external source. Now for one of my needs. I need to read that value is the specific XML tag and create the entry in the database.

    Column name DataType
    IDNumber
    RecordBLOB OBJECT

    This is the XML code that is stored in the file inside the BLOB field format. XML below, I need go get AMC1234 there is after < itemName > text < / itemName > I thought to use XMLTYPE, but unfortunately my DBA team does not XML database, I now use UTL_RAW. CAST_TO_VARCHAR2 and recovery entire string, but I am not able to read actual result it takes. Can someone help me remove AMC1234.

    <? XML version = "1.0"? >

    <! DOCTYPE importFile SYSTEM "xyz.dtd" >

    -< importFile >

    -< importResult >

    < mode status = "DΘFINIR" > general failure < / status >

    < statusCode > 1 < / statusCode >

    invalid < errorMsg > list and holiday component < / errorMsg >

    -< returnInfo >

    < itemName > PRQ < / itemName >

    < Valeurelement > CBA < / Valeurelement >

    < / returnInfo >

    -< returnInfo >

    < itemName > LMP < / itemName >

    < Valeurelement > CBA < / Valeurelement >

    < / returnInfo >

    -< returnInfo >

    < itemName > KEY < / itemName >

    < Valeurelement > 9999 < / Valeurelement >

    < / returnInfo >

    -< returnInfo >

    < itemName > text < / itemName >

    < Valeurelement > AMC1234, FIXED_ALL, RED < / Valeurelement >

    < / returnInfo >

    < / importResult >

    < / importFile >


    Thank you

    Without

    Without - try something like...

    with t as (select"

    -

    -

    General failure

    1

    component and invalid vacation list

    -

    PRQ

    ABC

    -

    LMP

    ABC

    -

    KEY

    9999

    -

    Text

    AMC1234, FIXED_ALL, RED

    "the double pass."

    )

    Select Replace (regexp_substr (col,'([^<>']) itemName))

    , replace (regexp_substr (col,'([^<>""]) Valeurelement))

    t

    connection of level <=> ');

  • 'Value not completed for attribute "in the XML tag". (SBL-UIF-00265) »

    To get this message when I change a Web layout for a display in Siebel tools 7.8.2 "unfinished value for the attribute"in the XML tag". (SBL-UIF-00265) «... Anyone has an idea why I get this message?

    Hello

    Check the webtemplate to view file. The WT file may contain a double quote in some tags. Maybe it's the cause of the error. U have changed the SWT file by accident. Refer to ID 1280569.1 Web of Support of Oracle for more information.

    Kind regards
    Joseph

  • Need help to retrieve the value of an xml tag.

    Hi all

    Hello all, I have problem to extract a value from an xml tag. I created an xml schema based on the schema, I created an xmltype table and inserted a value to the table. When I try to extract a value of a particular tag I can't do... Kindly help me to solve this problem. Here by I write all working, I did...

    I use the following client:
    -----------------------------------

    SQL * more: Release 10.2.0.1.0 - Production on Mon 31 Jan 11:44: 59 2011

    Copyright (c) 1982, 2005, Oracle. All rights reserved.


    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With partitioning, OLAP and Data Mining options


    ////////////////////////////////// XML Schema ///////////////////////

    Start
    () dbms_xmlschema.registerSchema
    "http://www.oradev.com/chipsxml.xsd,"
    ' < scheme xmlns = "http://www.w3.org/2001/XMLSchema".
    targetNamespace = "http://www.oradev.com/chipsxml.xsd."
    xmlns:SAMP = "http://www.oradev.com/chipsxml.xsd".
    version = "1.0" >

    < feature name = 'Field1' >
    < complexType >
    <>sequence
    < element name = "UTI" >
    < complexType >
    <>sequence
    < element name = "U01" type = "string" / >
    < element name = "U02" type = "string" / >
    < element name = "U03" type = "string" / >
    < element name = "U03a" type = "string" / >
    < element name = "U03b" type = "string" / >
    < element name = "U03c" type = "string" / >
    < element name = "U04" type = "string" / >
    < element name = "U05" type = "string" / >
    < / sequence >
    < / complexType >
    < / item >
    < / sequence >
    < / complexType >
    < / item >
    < / schema > ',
    (TRUE, TRUE, FALSE, FALSE);
    end;


    A table that has several column.

    CREATE TABLE chipsxmltable1)
    Identification number, XMLDATA XmlType)
    XMLTYPE XMLDATA STORE AS OBJECT / RELATIONAL
    XMLSCHEMA 'http://www.oradev.com/chipsxml.xsd '.
    ELEMENT 'field1 ';


    Insert the query in chipsxmltable.

    INSERT INTO (VALUES) chipsxmltable
    XmlType.CreateXml ("<?") XML version = "1.0"? >
    < xmlns:samp samp: field1 = "http://www.oradev.com/chipsxml.xsd" >
    < USE >
    No. < U01 > < / U01 >
    Y < U02 > < / U02 >
    Y < U03 > < / U03 >
    < U03a > Y < / U03a >
    < U03b > Y < / U03b >
    < U03c > Y < / U03c >
    Y < U04 > < / U04 >
    Y < U05 > < / U05 >
    < / UTI >
    ((< / samp: field1 > '));


    To display the data in a field with the structure:
    --------------------------------------------

    1. motion:
    ----------
    Select * from chipsxmltable1;

    Output:
    -------


    ID XMLDATA
    ---------- -----------------------------------------------------------------
    1 <? XML version = "1.0"? >
    < xmlns:samp samp: field1 = "http://www.oradev.com/chipsxml.xsd" >
    < USE >
    No. < U01 > < / U01 >
    No. < U02 > < / U02 >
    Y < U03 > < / U03 >
    < U03a > Y < / U03a >
    < U03b > Y < / U03b >
    < U03c > Y < / U03c >
    Y < U04 > < / U04 >
    Y < U05 > < / U05 >
    < / UTI >
    < / samp: field1 >


    2 query: (both the query shows the same result)
    ----------

    SELECT X.xmldata.getClobVal ('XMLDATA' FROM chipsxmltable1 X);

    Select extract (XMLDATA, "/ Field1'") .getstringval ("XMLDATA" chipsxmltable1 x);


    Output:
    --------

    XMLDATA
    -----------------------------------------------------------------
    <? XML version = "1.0"? >
    < xmlns:samp samp: field1 = "http://www.oradev.com/chipsxml.xsd" >
    < USE >
    No. < U01 > < / U01 >
    No. < U02 > < / U02 >
    Y < U03 > < / U03 >
    < U03a > Y < / U03a >
    < U03b > Y < / U03b >
    < U03c > Y < / U03c >
    Y < U04 > < / U04 >
    Y < U05 > < / U05 >
    < / UTI >
    < / samp: field1 >


    To display the data as a single string without structure using "getstringval()":
    ---------------------------------------------------------------------------------

    3 query
    ---------

    Select extract (XMLDATA, "//text()').getstringval()"CHIPS - XML"of chipsxmltable1 x;)

    Output:
    -------

    CHIPS - XML
    ---------------------
    NoNoYYYYYY


    To display the data as a single string without structure using "getclobval()":
    ---------------------------------------------------------------------------------

    4 query
    -------

    Select extract (XMLDATA, "//text()').getClobVal()"CHIPS - XML"of chipsxmltable1 x;)

    Output:
    --------

    CHIPS - XML
    -----------------
    NoNoYYYYYY


    To display the data in a tag with or without structure (which does work) using the function "EXTRACT":
    -------------------------------------------------------------------------------------------------------------

    6.query:
    ---------

    Select extract (XMLDATA, "/Field1/text()').getstringval()"XMLDATA' chipsxmltable1 x;

    Select extract (XMLDATA, "/Field1/UTI').getstringval()"XMLDATA' chipsxmltable1 x;

    Select extract (XMLDATA, "/Field1/UTI/U01').getstringval()"XMLDATA' chipsxmltable1 x;

    Select extract (XMLDATA, "/Field1/UTI/U01/text()').getstringval()"XMLDATA' chipsxmltable1 x;


    Output:
    --------

    CHIPS - XML
    ---------------------------------------



    The queries above are not fetch the value.



    To display the data in a tag with or without structure (which does work) using the function "EXTRACTVALUE":
    ------------------------------------------------------------------------------------------------------------------

    7 query:
    ----------

    Select extractValue (XMLDATA, ' / Field1/UTI ') 'XMLDATA' of chipsxmltable1 x;

    Select extractValue (XMLDATA, ' / U01/UTI/Field1 ') 'XMLDATA' of chipsxmltable1 x;


    Output:
    --------

    X
    -



    The queries above are not fetch the value.


    My question is:
    --------------------
    How to extract the values of xml tag when the value are inserted through xml schema?


    My apologies if the description is not clear. Kindly let me know if further details are required. Thanks a lot for your help.

    Very cordially,
    Godwin Castro C.V.

    Hello

    You must declare the namespace of each element used in the XPath expression, like this:

    SQL> select extractvalue( XMLDATA
      2                     , '/samp:Field1/UTI/U01'
      3                     , 'xmlns:samp="http://www.oradev.com/chipsxml.xsd"' ) "XMLDATA"
      4  from chipsxmltable1 x
      5  ;
    
    XMLDATA
    --------------------------------------------------------------------------------
    No
     
    
    SQL> select extract( XMLDATA
      2                , '/samp:Field1/UTI'
      3                , 'xmlns:samp="http://www.oradev.com/chipsxml.xsd"'
      4                ).getstringval() "XMLDATA"
      5  from chipsxmltable1 x
      6  ;
    
    XMLDATA
    --------------------------------------------------------------------------------
    
      No
      Y
      Y
      Y
      Y
      Y
      Y
      Y
    
     
    

    Please see EXTRACT and EXTRACTVALUE documentation:
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/functions051.htm#i1006712
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/functions052.htm#SQLRF06173

    BTW, 'XMLDATA' is a pseudo-column used by Oracle. I don't know if it will never cause any conflict, but perhaps you need to rename your column.
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/pseudocolumns010.htm#SQLRF00256

    Kind regards.

  • Cannot delete the XML tag

    Hi all! Working in InD CS6 in Windows 7.

    I have a XML element in a document that I can't do anything with and who does not appear to be associated with what in the file of the InD. The red line is pointing to it on the Panel Structure in the image below. Note the X through its icon.

    ErrantXMLElement.JPG

    The XML is added to the InD file by mapping tags to styles using the Load... button on the dialog box map tags to Styles and 'import' of another document of the InD.

    When right clicking this item in the Structure of Panel and selecting go to point the current selection goes, but then nothing else happens. Or to delete this in the Panel of Structures . I had a similar problem, a bit a go where I somehow finished with elements in the XML file that were not associated with what anyone in the document. Had those text display in the Structure Panel after the name as shown above, but, even once, go at them will not anywhere. I hadn't studied at the time because I could simply remove it from the structure.

    With this element, however, I can't get rid of it without marking not any frame.

    So, I guess I really questions. It's this thing! How the hell he get there? And is there a better way to remove it rather than not tagging any of the frame and have to re - mark all content.

    EDIT: Just found out that using the trash on the pallet Structure to remove the parent of the problematic element, indeed, removes as problematic. Before him, I was just not marking the parent who has transferred only the problem child (like these word games) for the previous parent.

    Thanks for reading this way-too-long-post.

    All the best,

    Ken

    OK (he said with a blush to cheeks) I get noticed something in common, I didn't before posting.

    Page to which cchimi kindly provided a link described icon as a part empty, and it is attached to an empty block. However, it is not only an empty block.

    What happened in our file, is that the script containing the tag with an anchor marker tag xml that InD apparently do not like much. Type of logic, really.

    Now, I may be cracking, but with a single instance of the element of 'bad' I thought THAT I could see the empty element in the story discovers with the anchor to a few characters on. I selected the anchor and dragged back between the start and end code and icon of the item has changed and he returned 'alive', I was able to handle it. For most other troublesome elements, however, sinpy AND marking a marker of the anchor, the XML tag does NOT display in story mode. The element gets the empty icon when you simply tag the anchor marker, in this case it is an anchor for a rule.

    Hope this might help someone, someday.

    Thanks again for reading.

  • Load the XML file into Oracle external Table


    I load the data from the XML file into an intermediate table Oracle using external Tables.

    Let's say below, it is my XML file

    < header >
    < A_CNT > 10 < / A_CNT >
    < E_CNT > 10 < / E_CNT >
    < AF_CNT > 10 < / AF_CNT >
    < / header >
    < student >
    <>students-details
    < Student_info >
    < Single_Info >
    < ID > 18 / < ID >
    New York < City > < / City >
    < country > United States < / country >
    < Name_lst >
    < Student_name >
    Samuel < name > < / name >
    Paul < Last_name > < / Last_name >
    < DOB > 19871208 < / DOB >
    Aware of < RecordStatus > < / RecordStatus >
    < / Student_name >
    < Student_name >
    Samuel < name > < / name >
    Paul < Last_name > < / Last_name >
    < DOB > 19871208 < / DOB >

    < TerminationDt > 20050812 < / TerminationDt >
    History of < RecordStatus > < / RecordStatus >
    < / Student_name >
    < / Name_lst >
    < Personal_Info >
    <>men < / Type >
    < 27 > < / Age >
    < / Personal_Info >
    < / Single_Info >
    < / Student_info >

    < student - register >
    class < A >
    < info >
    < detail >
    < ID student > 18 < / student >
    EE < major > < / Major >
    < course-Grades >
    < course > VLSI < / course >
    < degree > 3.0 < / Grade >
    < / course-Grades >
    < course-Grades >
    < course > nanotechnology < / course >
    < degree > 4.0 < / Grade >
    < / course-Grades >
    < / details >
    < detail >
    < ID student > 18 < / student >
    THIS < major > < / Major >
    < / details >
    < / info >
    class < A >
    < Student_Enrol >
    <>students-details
    < student >

    I load this XML data file into a single table using an external Table. Could someone help me please with coding.

    Thank you

    Reva

    Could you please help me how to insert my XML content into that.

    Same as before, try a plain old INSERT:

    insert into xml_pecos

    values)

    XmlType (bfilename ('XML_DIR', "test.xml"), nls_charset_id ('AL32UTF8'))

    );

    But you'll probably hit the same limitation as with the binary XMLType table.

    In this case, you can use FTP to load the file as a resource in the XML DB repository.

    If the XML schema has been registered with the hierarchy enabled then the file will be automatically inserted into the table.

    Could you post the exact statement that you used to save the scheme?

    In the meantime, you can also read this article, I did a few years ago, it covers the XML DB features that may be useful here, including details on how to load the file via FTP:

    https://odieweblog.WordPress.com/2011/11/23/Oracle-XML-DB-a-practical-example/

    And documentation of the course: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb06stt.htm#ADXDB4672

  • Extract the XML tags and insert into the table

    Description:

    XML is under inert atmosphere in the table containing the xmltype column. Need to extract value from xml tag and insert into the table.
    Once the XML record Treaty must update the status as 'Y' in the base table

    Problem:
    There are multiple occurrences of some tags that need to be combined and stored in a single column to delineate the '-'. No. area of occurrence can vary for each record.
    There are a few encrypted column that I managed to convert decoded value. But used select distinct... XMLTYPE...
    GTT table is used to store the intermediate result and decoding and the concatenation of several tags occurred using TWG.

    1.No. multiple tag will vary how to extract those and concatenate them into a single column. I assumed his occrrence in 3 for example: < student >
    2. how to set the value NULL if no tag is not present. Tag in XML record number can vary. I know that the complete list of xmltags.
    3 data not found error for some xml documents.

    Kindly Assits how to achieve this.

    version: 11.2.0.3.0

    Table Base: temp_XML

    XML_ID NOT NULL NUMBER (28) - auto-increment using the sequence
    PUBLIC EVENT. Stores the XMLTYPE STORAGE BINARY - XML file
    DATE OF EVTDATE
    STATUS VARCHAR2 (3) DEFAULT ' don't

    Sample XML: Includes all the brands mentioned in the common procedure below.

    <? XML version = "1.0" encoding = "US-ASCII"? >

    "< event xmlns ="http://xmlextrac.test.com/object">."

    < data xmlns = "" >

    < object >

    <>units

    < unit > TLAS < / unit >

    < unit > ATLAS < / unit >

    < / units >

    < receiverNetworks >

    < receiverNetwork > ABSAZAJ0XXXX < / receiverNetwork >

    < / receiverNetworks >

    < correspondentIds >

    < correspondentId > #SWF - ABSAZAJ0XXX < / correspondentId >

    < / correspondentIds >

    < comment >

    < comment / >

    < comment / >

    < comment / >

    < comment / >

    < / comment >

    < memo >

    < memo > 28 < / memo >

    < / memos >

    < tuxedoPriority > 20 < / tuxedoPriority >

    sender <>Mike < / sender >

    < typeReseauId > Message < / typeReseauId >

    < maxRetry > 4 < / maxRetry >

    < msgSecuLevel > CBA < / msgSecuLevel >

    < quantity >

    < amount > 12 < / amount >

    < amount > 34 < / amount >

    < amount > 56 < / amount >

    < / amounts >

    < currencys >

    < currency > $ < / currency >

    < currency > EUR < / currency >

    INR < currency > < / currency >

    < / currencys >

    < msgDateVal > ARST123 < / msgDateVal >

    wder < direction > < / direction >

    < eventType > 113 < / eventType >

    < date > 1407431619 < / date >

    < eventDate > 1407431624 < / eventDate >

    < management > R < / direction >

    < msgRef > R950140807AB6CBE < / msgRef >

    < format > SWF < / size >

    < type > 950 < / type >

    R950140807AB6CBE < WALL > < / WALL >

    < bankingPriority / >

    FSDS < field.20 > < / field.20 >

    < texteType > FSS < / texteType >

    < applicationCode > OHS < / applicationCode >

    < company > KETH < / company >

    < endFct > MOE < / endFct >

    < rate > BAM < / flow >

    < subtype / >

    < text > DQo6MjA6R0wxNDA4MDcwMDA1MTMNCjoyNTo3M == < / text >

    < msgHeaders > ezE6RjAxTE9ZRE5MMjBCWFhYMDAzMjAw = < / msgHeaders >

    < msgTrailer > ezU6e0NISzpEOUFFRUNCN0NBQTl9e1RORzp9fQ == < / msgTrailer >

    < / object >

    < / data >

    Procedure: This works very well for a few xml record and fails for some.

    CREATE OR REPLACE PROCEDURE XML_EXTR
    AS
    CURSOR c1
    IS
    SELECT * FROM temp_XML;

    c1_cur c1% ROWTYPE;

    bamdata_sql VARCHAR2 (3000);
    d_text VARCHAR2 (3000);
    d_msgHeaders VARCHAR2 (3000);
    d_msgTrailer VARCHAR2 (3000);
    x_text VARCHAR2 (3000);
    x_msgHeaders VARCHAR2 (3000);
    x_msgTrailer VARCHAR2 (3000);
    x_eventType VARCHAR2 (3000);
    x_amount number (28.2).
    x_currency VARCHAR2 (3000);
    x_state VARCHAR2 (3000);
    x_units VARCHAR2 (3000);
    x_correspondentId VARCHAR2 (3000);
    X_TYPE VARCHAR2 (3000);
    x_receiverNetworks VARCHAR2 (3000);
    x_bankingPriority VARCHAR2 (3000);
    x_applicationCode VARCHAR2 (3000);
    x_processCounter VARCHAR2 (3000);
    x_obsolescence VARCHAR2 (3000);
    x_maxRetry VARCHAR2 (3000);
    x_retries VARCHAR2 (3000);
    x_fileSize VARCHAR2 (3000);
    x_endFct VARCHAR2 (3000);
    x_subType VARCHAR2 (3000);
    x_field20 VARCHAR2 (3000);
    x_sequenceNumber VARCHAR2 (3000);
    x_requestorDn VARCHAR2 (3000);
    x_responderDn VARCHAR2 (3000);
    x_SWIFTNetService VARCHAR2 (3000);
    x_transfertRef VARCHAR2 (3000);
    x_nonrepudiation VARCHAR2 (3000);
    x_transfertInfo VARCHAR2 (3000);
    x_fileDesc VARCHAR2 (3000);
    x_transfertDesc VARCHAR2 (3000);
    x_logicalName VARCHAR2 (3000);
    x_signIndicator VARCHAR2 (3000);
    x_critId VARCHAR2 (3000);
    x_inFapId VARCHAR2 (3000);
    x_deliveryNotif VARCHAR2 (3000);
    x_comment1 VARCHAR2 (3000);
    x_comment2 VARCHAR2 (3000);
    x_comment3 VARCHAR2 (3000);
    x_comment4 VARCHAR2 (3000);
    x_comments VARCHAR2 (3000);
    x_memo1 VARCHAR2 (3000);
    x_memo2 VARCHAR2 (3000);
    x_memo3 VARCHAR2 (3000);
    x_memo4 VARCHAR2 (3000);
    x_msgSecuLevel VARCHAR2 (3000);
    x_dates VARCHAR2 (3000);
    x_tuxedoPriority VARCHAR2 (3000);
    x_fileDest VARCHAR2 (3000);
    x_stkMsgPDEId VARCHAR2 (3000);
    x_EMTId VARCHAR2 (3000);
    x_LTRcptSyno VARCHAR2 (3000);
    x_LTRcpt VARCHAR2 (3000);
    x_LTEmis VARCHAR2 (3000);
    x_flow VARCHAR2 (3000);
    x_FINCopy VARCHAR2 (3000);
    x_msgDateVal VARCHAR2 (3000);
    x_eventDate VARCHAR2 (3000);
    x_typeReseauId VARCHAR2 (3000);
    x_inFapSeq1 VARCHAR2 (3000);
    x_inFapSeq2 VARCHAR2 (3000);
    x_direction VARCHAR2 (3000);
    x_priority VARCHAR2 (3000);
    x_ack VARCHAR2 (3000);
    x_format VARCHAR2 (3000);
    x_mur VARCHAR2 (3000);
    x_TexteType VARCHAR2 (3000);
    x_creatingUser VARCHAR2 (3000);
    x_fileinfo VARCHAR2 (3000);
    x_company VARCHAR2 (3000);
    x_language VARCHAR2 (3000);
    x_ackText VARCHAR2 (3000);
    x_jaxbRef VARCHAR2 (3000);
    x_jaxbElt VARCHAR2 (3000);
    x_memos VARCHAR2 (3000);
    xmlid number (28);
    x_msgRef1 VARCHAR2 (3000);
    x_msgRef2 VARCHAR2 (3000);
    x_msgRef3 VARCHAR2 (3000);
    x_msgRef4 VARCHAR2 (3000);
    x_sender VARCHAR2 (3000);
    x_amlBehavior VARCHAR2 (3000);
    x_ownerServiceId VARCHAR2 (3000);
    x_correspondentName VARCHAR2 (3000);
    x_correspondentAddress1 VARCHAR2 (3000);
    x_correspondentAddress2 VARCHAR2 (3000);
    x_correspondentAddress3 VARCHAR2 (3000);
    x_correspondentAddress4 VARCHAR2 (3000);
    x_correspondentCity VARCHAR2 (3000);
    x_correspondentCountry VARCHAR2 (3000);
    x_correspondentNetworkAddr VARCHAR2 (3000);
    x_tested VARCHAR2 (3000);
    x_correspondentNetwork VARCHAR2 (3000);
    x_validatedPercentage VARCHAR2 (3000);
    x_nbOfValid VARCHAR2 (3000);
    x_requestRef VARCHAR2 (3000);
    x_notifQueue VARCHAR2 (3000);
    x_requestType VARCHAR2 (3000);
    x_secBpid VARCHAR2 (3000);
    x_queue VARCHAR2 (3000);
    x_receiverCode VARCHAR2 (3000);
    x_receiverInd VARCHAR2 (3000);
    x_validFlag VARCHAR2 (3000);
    x_ownerId VARCHAR2 (3000);
    x_dn VARCHAR2 (3000);
    x_RMAOurBic VARCHAR2 (3000);
    x_RMACorrespondentBic VARCHAR2 (3000);
    x_RMAService VARCHAR2 (3000);
    x_fileMsgRef VARCHAR2 (3000);
    date of x_ext_date;
    x_correspondentAddress VARCHAR2 (3000);
    x_msgrefs varchar2 (3000);
    d_ackText varchar2 (3000);
    ackText varchar2 (3000);
    date of x_extdate;

    BEGIN

    FOR C1_CUR IN C1

    LOOP

    INSERT INTO data_GTT_TEMP)
    eventType, amount, currency, State, units, correspondentId, sender, receiverNetworks, bankingPriority, applicationCode, processCounter.
    obsolescence, maxRetry, reminders, fileSize, endFct, xsubType, field.20, sequenceNumber, requestorDn, responderDn, SWIFTNetService, non-repudiation,
    transfertRef, transfertInfo, fileDesc, transfertDesc, logicalName, signIndicator, critId, inFapId, deliveryNotif, comment1, comment2, comment3, comment4,
    Memo1, memo2, memo3, memo4, msgSecuLevel, dates, tuxedoPriority, fileDest, stkMsgPDEId, EMTId, LTRcptSyno, LTRcpt, LTEmis, flow, FINCopy, msgDateVal,
    eventDate, typeReseauId, inFapSeq1, inFapSeq2, direction, priority, ack,
    msgRef1, msgRef2, msgRef3, msgRef4, amlbehavior, correspondentName, ownerServiceId,
    correspondentAddress1, correspondentAddress2, correspondentAddress3, correspondentAddress4,
    correspondentCity, correspondentCountry, correspondentNetworkAddr, tested,
    correspondentNetwork, validatedPercentage, nbOfValid, requestRef, notifQueue,
    requestType, secBpid, xqueue, receiverCode, receiverInd, validFlag, ownerId, dn, RMAOurBic, RMACorrespondentBic, RMAService,
    fileMsgRef, format, xtype, wall, TexteType, creatingUser, fileinfo,
    company, text, xlanguage, ackText, msgHeaders, msgTrailer, jaxbRef, jaxbElt)
    SELECT
    x.eventType, x.amount, x.currency, x.state, x.units, x.correspondentId, x.sender, x.receiverNetworks, x.bankingPriority, x.applicationCode, x.processCounter,
    x.obsolescence, x.maxRetry, x.Retries, x.FileSize, x.endFct, x.xsubType, x.Field20, x.SequenceNumber, x.requestorDn, x.responderDn, x.SWIFTNetService, x.nonRepudiation,
    x.transfertRef, x.transfertInfo, x.fileDesc, x.transfertDesc, x.logicalName, x.signIndicator, x.critId, x.inFapId, x.deliveryNotif, x.comment1, x.comment2,
    x.comment3, x.comment4, x.Memo1, x.memo2, x.memo3, x.MEMO4, x.msgSecuLevel, x.dates, x.tuxedoPriority, x.fileDest, x.stkMsgPDEId, x.EMTId, x.LTRcptSyno,
    x.LTRcpt, x.LTEmis, x.flow, x.FINCopy, x.msgDateVal, x.eventDate, x.typeReseauId, x.inFapSeq1, x.inFapSeq2, x.direction, x.priority, x.ack,
    x.msgRef1, x.msgRef2, x.msgRef3, x.msgRef4, x.amlbehavior, x.correspondentName, x.ownerServiceId,
    x.correspondentAddress1, x.correspondentAddress2, x.correspondentAddress3, x.correspondentAddress4,
    x.correspondentCity, x.correspondentCountry, x.correspondentNetworkAddr, x.tested,
    x.correspondentNetwork, x.validatedPercentage, x.nbOfValid, x.requestRef, x.notifQueue,
    x.requestType, x.secBpid, x.xqueue, x.receiverCode, x.receiverInd, x.validFlag, x.ownerId, x.dn, x.RMAOurBic, x.RMACorrespondentBic, x.RMAService,
    x.fileMsgRef, x.format, x.xtype, x.mur, x.TexteType, x.creatingUser, x.fileinfo,
    x.Company, x.Text, x.xLanguage, x.ackText, x.msgHeaders, x.msgTrailer, x.jaxbRef, x.jaxbElt

    of temp_XML t, XMLTABLE (XMLNAMESPACES ('http://xmlextrac.test.com/object' as "ns0"), ' / ns0:event' )
    PASSAGE t.BAM_EVENT COLUMNS
    eventType varchar2 (3000) PATH 'data, object, eventType' DEFAULT NULL,
    amount number (28.2) path data/object/amounts"."
    currency varchar2 (3000) PATH 'data, object, currencys, currency' DEFAULT NULL,
    VARCHAR2 (3000) path "data/object / / state of ' DEFAULT NULL, State
    units varchar2 (3000) PATH ' object/data/units' DEFAULT NULL,
    correspondentId varchar2 (3000) PATH "data/object/correspondentIds' DEFAULT NULL,
    sender varchar2 (3000) PATH 'data, object, sender' DEFAULT NULL,
    receiverNetworks varchar2 (3000) PATH "data/object/receiverNetworks' DEFAULT NULL,
    bankingPriority varchar2 (3000) PATH "data/object/bankingPriority' DEFAULT NULL,
    applicationCode varchar2 (3000) PATH ' object/data/applicationCode' DEFAULT NULL,
    processCounter varchar2 (3000) PATH "data/object/processCounter' DEFAULT NULL,
    obsolescence varchar2 (3000) PATH ' data/object/obsolescence' DEFAULT NULL,
    maxRetry varchar2 (3000) PATH ' data/object/maxRetry' DEFAULT NULL,
    attempts to varchar2 (3000) "data/object/attempts" DEFAULT NULL path,.
    size of the file varchar2 (3000) PATH ' data/object/fileSize' DEFAULT NULL,
    endFct varchar2 (3000) PATH "data/object/endFct' DEFAULT NULL,
    xsubType varchar2 (3000) PATH "data/object/subtype' DEFAULT NULL,
    field.20 varchar2 (3000) PATH ' object/data/field.20' DEFAULT NULL,
    sequenceNumber varchar2 (3000) PATH "data/object/sequenceNumber" DEFAULT NULL,
    requestorDn varchar2 (3000) PATH "data/object/requestorDn' DEFAULT NULL,
    responderDn varchar2 (3000) PATH "data/object/responderDn' DEFAULT NULL,
    SWIFTNetService varchar2 (3000) PATH "data/object/SWIFTNetService' DEFAULT NULL,
    non-repudiation varchar2 (3000) PATH ' object/data/repudiation' DEFAULT NULL,
    transfertRef varchar2 (3000) PATH "data/object/transfertRef' DEFAULT NULL,
    transfertInfo varchar2 (3000) PATH "data/object/transfertInfo' DEFAULT NULL,
    fileDesc varchar2 (3000) PATH "data/object/fileDesc' DEFAULT NULL,
    transfertDesc varchar2 (3000) PATH "data/object/transfertDesc' DEFAULT NULL,
    logicalName varchar2 (3000) PATH "data/object/logicalName" DEFAULT NULL,
    signIndicator varchar2 (3000) PATH "data/object/signIndicator' DEFAULT NULL,
    critId varchar2 (3000) PATH "data/object/critId' DEFAULT NULL,
    inFapId varchar2 (3000) PATH "data/object/inFapId' DEFAULT NULL,
    deliveryNotif varchar2 (3000) PATH "data/object/deliveryNotif' DEFAULT NULL,
    COMMENT1 varchar2 (3000) PATH ' data, subject, comments, comment [1] "DEFAULT NULL,
    comment2 varchar2 (3000) PATH 'data, subject, comments, how [2]' DEFAULT NULL,
    comment3 varchar2 (3000) PATH "data/object/observations/comments [3]" DEFAULT NULL,
    comment4, varchar2 (3000) PATH ' data, subject, comments, comment [4] "DEFAULT NULL,
    Memo1 varchar2 (3000) PATH "data/object/memos/memo [1]" DEFAULT NULL,
    Memo2 varchar2 (3000) PATH "data/object/notes/Notes [2]" DEFAULT NULL,
    memo3 varchar2 (3000) PATH "data/object/memos/memo [3]" DEFAULT NULL,
    MEMO4 varchar2 (3000) PATH "data/object/memos/memo [4]" DEFAULT NULL,
    msgSecuLevel varchar2 (3000) PATH "data/object/msgSecuLevel' DEFAULT NULL,
    Date varchar2 (3000) PATH ' object/data/date' DEFAULT NULL,
    tuxedoPriority varchar2 (3000) PATH "data/object/tuxedoPriority' DEFAULT NULL,
    fileDest varchar2 (3000) PATH "data/object/fileDest' DEFAULT NULL,
    stkMsgPDEId varchar2 (3000) PATH "data/object/stkMsgPDEId' DEFAULT NULL,
    EMTId varchar2 (3000) PATH "data/object/EMTId' DEFAULT NULL,
    LTRcptSyno varchar2 (3000) PATH "data/object/LTRcptSyno' DEFAULT NULL,
    LTRcpt varchar2 (3000) PATH "data/object/LTRcpt' DEFAULT NULL,
    LTEmis varchar2 (3000) PATH "data/object/LTEmis' DEFAULT NULL,
    flow varchar2 (3000) PATH "/ object/data flow ' DEFAULT NULL,
    FINCopy varchar2 (3000) PATH ' data/object/FINCopy' DEFAULT NULL,
    msgDateVal varchar2 (3000) PATH "data/object/msgDateVal' DEFAULT NULL,
    eventDate varchar2 (3000) PATH "data/object/eventDate" DEFAULT NULL,
    typeReseauId varchar2 (3000) PATH "data/object/typeReseauId' DEFAULT NULL,
    inFapSeq1 varchar2 (3000) PATH "data/object/inFapSeq1' DEFAULT NULL,
    inFapSeq2 varchar2 (3000) PATH "data/object/inFapSeq2' DEFAULT NULL,
    direction varchar2 (3000) PATH 'data, object, direction' DEFAULT NULL,
    priority varchar2 (3000) PATH ' data/object/priority' DEFAULT NULL,
    ACK varchar2 (3000) PATH ' object/data/ack' DEFAULT NULL,
    msgRef1 varchar2 (3000) PATH ' data, object, msgRefs, msgRef [1] "DEFAULT NULL,
    msgRef2 varchar2 (3000) PATH ' data, object, msgRefs, msgRef [2] "DEFAULT NULL,
    msgRef3 varchar2 (3000) PATH ' data, object, msgRefs, msgRef [3] "DEFAULT NULL,
    msgRef4 varchar2 (3000) PATH ' data, object, msgRefs, msgRef [4] "DEFAULT NULL,
    amlBehavior varchar2 (3000) PATH "data/object/amlBehavior' DEFAULT NULL,
    ownerServiceId varchar2 (3000) PATH "data/object/ownerServiceId' DEFAULT NULL,
    correspondentName varchar2 (3000) PATH ' data/object/correspondentName' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of correspondentAddress1 ' object/data/correspondentLine1Addresse' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of correspondentAddress2 ' object/data/correspondentLine2Addresse' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of correspondentAddress3 ' object/data/correspondentLine3Addresse' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of correspondentAddress4 ' object/data/correspondentLine4Addresse' DEFAULT NULL,
    correspondentCity PATH VARCHAR2 (3000) ' object/data/correspondentCity' DEFAULT NULL,
    correspondentCountry PATH VARCHAR2 (3000) ' object/data/correspondentCountry' DEFAULT NULL,
    correspondentNetworkAddr PATH VARCHAR2 (3000) ' object/data/correspondentNetworkAddr' DEFAULT NULL,
    tested VARCHAR2 (3000) PATH ' data/object/tested' DEFAULT NULL,
    correspondentNetwork PATH VARCHAR2 (3000) ' object/data/correspondentNetwork' DEFAULT NULL,
    validatedPercentage PATH VARCHAR2 (3000) ' object/data/validatedPercentage' DEFAULT NULL,
    nbOfValid PATH VARCHAR2 (3000) ' object/data/nbOfValid' DEFAULT NULL,
    requestRef VARCHAR2 (3000) PATH ' data/object/requestRef' DEFAULT NULL,
    notifQueue PATH VARCHAR2 (3000) ' object/data/notifQueue' DEFAULT NULL,
    requestType PATH VARCHAR2 (3000) ' data/object/requestType' DEFAULT NULL,
    secBpid PATH VARCHAR2 (3000) ' object/data/secBpid' DEFAULT NULL,
    xqueue PATH VARCHAR2 (3000) ' data/object/tail' DEFAULT NULL,
    receiverCode PATH VARCHAR2 (3000) ' object/data/receiverCode' DEFAULT NULL,
    receiverInd PATH VARCHAR2 (3000) ' object/data/receiverInd' DEFAULT NULL,
    validFlag PATH VARCHAR2 (3000) ' object/data/validFlag' DEFAULT NULL,
    ownerId PATH VARCHAR2 (3000) ' data/object/ownerId' DEFAULT NULL,
    DN VARCHAR2 (3000) PATH ' data/object/dn' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of RMAOurBic ' object/data/RMAOurBic' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of RMACorrespondentBic ' object/data/RMACorrespondentBic' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of RMAService ' object/data/RMAService' DEFAULT NULL,
    fileMsgRef PATH VARCHAR2 (3000) ' object/data/fileMsgRef' DEFAULT NULL,
    ackText varchar2 (3000) PATH "data/object/ackText' DEFAULT NULL,
    format varchar2 (3000) PATH "data/object / ' DEFAULT NULL,
    xType varchar2 (3000) PATH ' data/object/type' DEFAULT NULL,
    Wall varchar2 (3000) PATH ' data/object/wall' DEFAULT NULL,
    texteType varchar2 (3000) PATH "data/object/texteType' DEFAULT NULL,
    creatingUser varchar2 (3000) PATH ' data/object/creatingUser' DEFAULT NULL,
    fileInfo varchar2 (3000) PATH ' data/object/fileInfo' DEFAULT NULL,
    VARCHAR2 (3000) path ' data/object/society' DEFAULT NULL, the company
    VARCHAR2 (3000) text ' data/object/text' DEFAULT NULL path.
    xLanguage varchar2 (3000) PATH ' data/object/language' DEFAULT NULL,
    msgHeaders varchar2 (3000) PATH "data/object/msgHeaders' DEFAULT NULL,
    msgTrailer varchar2 (3000) PATH "data/object/msgTrailer' DEFAULT NULL,
    jaxbRef varchar2 (3000) PATH ' info/jaxbRef' DEFAULT NULL,
    jaxbElt varchar2 (3000) PATH "jaxbElt/info") x
    where t.XML_ID = c1_cur. XML_ID and t.status =' no;

    Select x.text, x.msgHeaders, x.msgTrailer in x_msgTrailer, x_msgHeaders, x_text of
    temp_XML t, XMLTABLE (XMLNAMESPACES ('http://xmlextrac.test.com/object' as "ns0"), ' / ns0:event' )
    PASSAGE t.BAM_EVENT COLUMNS
    text varchar2 (3000) PATH data/object/text"."
    msgHeaders varchar2 (3000) PATH "data/object/msgHeaders,"
    msgTrailer varchar2 (3000) PATH "object/data/msgTrailer.
    ) x
    where t.XML_ID = c1_cur. XML_ID;
    Select sysdate in double x_extdate;


    d_text: = utl_raw.cast_to_varchar2 (utl_encode.base64_decode (utl_raw.cast_to_RAW (x_text)));
    d_msgHeaders: = utl_raw.cast_to_varchar2 (utl_encode.base64_decode (utl_raw.cast_to_RAW (x_msgHeaders)));
    d_msgTrailer: = utl_raw.cast_to_varchar2 (utl_encode.base64_decode (utl_raw.cast_to_RAW (x_msgTrailer)));
    -d_ackText: = utl_raw.cast_to_varchar2 (utl_encode.base64_decode (utl_raw.cast_to_RAW (ackText)));

    Select
    EventType, amount, currency, State, units, correspondentid, sender, receivernetworks, bankingpriority,
    applicationcode, processcounter, obsolescence, maxretry, reminders, filesize, endfct, xsubtype, field.20, sequencenumber, requestordn,
    responderdn, swiftnetservice, non repudiation, transfertref, transfertinfo, filedesc, transfertdesc, logicalname, signindicator,
    critid, infapid, deliverynotif, comment1, comment2, comment3, comment4, memo1, memo2, memo3, memo4, msgseculevel, dates, tuxedopriority, filedest,
    stkmsgpdeid, emtid, ltrcptsyno, ltrcpt, ltemis, flow, fincopy, msgdateval, eventdate, typereseauid, infapseq1,
    infapseq2, direction, priority, ack, msgref1, msgref2, msgref3, msgref4, amlbehavior, ownerserviceid, correspondentname, correspondentaddress1, correspondentaddress2, correspondentaddress3, correspondentaddress4,
    correspondentcity, correspondentcountry, correspondentnetworkaddr, test, correspondentnetwork, validatedpercentage, nbofvalid,.
    requestref, notifqueue, requesttype, secbpid, xqueue, receivercode, receiverind, validflag, ownerid, dn, rmaourbic, rmacorrespondentbic, rmaservice, filemsgref,
    acktext, format, xtype, wall, textetype, creatinguser, fileinfo, society, text, xlanguage, msgheaders, msgtrailer, jaxbref, jaxbelt
    in
    x_eventtype, x_amount, x_currency, x_state, x_units, x_correspondentid, x_sender, x_receivernetworks, x_bankingpriority, x_applicationcode, x_processcounter,
    x_obsolescence, x_maxretry, x_retries, x_filesize, x_endfct, x_subtype, x_field20, x_sequencenumber, x_requestordn, x_responderdn, x_swiftnetservice, x_nonrepudiation,
    x_transfertref, x_transfertinfo, x_filedesc, x_transfertdesc, x_logicalname, x_signindicator, x_critid, x_infapid, x_deliverynotif, x_comment1, x_comment2, x_comment3,
    x_comment4, x_memo1, x_memo2, x_memo3, x_memo4, x_msgseculevel, x_dates, x_tuxedopriority, x_filedest, x_stkmsgpdeid, x_emtid, x_ltrcptsyno, x_ltrcpt,
    x_ltemis, x_flow, x_fincopy, x_msgdateval, x_eventdate, x_typereseauid, x_infapseq1, x_infapseq2, x_direction, x_priority, x_ack, x_msgref1, x_msgref2,
    x_msgref3, x_msgref4, x_amlbehavior, x_ownerserviceid, x_correspondentname, x_correspondentaddress1, x_correspondentaddress2, x_correspondentaddress3,
    x_correspondentaddress4, x_correspondentcity, x_correspondentcountry, x_correspondentnetworkaddr, x_tested, x_correspondentnetwork, x_validatedpercentage,
    x_nbofvalid, x_requestref, x_notifqueue, x_requesttype, x_secbpid, x_queue, x_receivercode, x_receiverind, x_validflag, x_ownerid, x_dn, x_rmaourbic,
    x_rmacorrespondentbic, x_rmaservice, x_filemsgref, x_acktext, x_format, x_type, x_mur, x_textetype, x_creatinguser, x_fileinfo, x_company, x_text,
    x_language, x_msgheaders, x_msgtrailer, x_jaxbref, data_GTT_TEMP x_jaxbelt;

    x_memos: = x_memo1 | » -'|| x_memo2 | » -'|| x_memo3 | » -'|| x_memo4;
    x_comments: = x_comment1 | » -'|| x_comment2 | » -'|| x_comment3 | » -'|| x_comment4;
    x_correspondentAddress: = x_correspondentAddress1 | » -'|| x_correspondentAddress2 | » -'|| x_correspondentAddress3 | » -'|| x_correspondentAddress4;
    x_msgrefs: = x_msgRef1 | » -'|| x_msgRef2 | » -'|| x_msgRef3 | » -'|| x_msgRef4;

    BEGIN


    insert into donnees_xml
    (xml_id, x_ext_date, eventtype, amount, currency, State, unit, correspondentid, sender, receivernetworks, bankingpriority, applicationcode,
    ProcessCounter, obsolescence, maxretry, reminders, filesize, endfct, xsubtype, field.20, sequencenumber, requestordn, responderdn,
    swiftnetservice, non repudiation, transfertref, transfertinfo, filedesc, transfertdesc, logicalname, signindicator, critid, infapid,
    deliverynotif, comments, notes, msgseculevel, dates, tuxedopriority, filedest, stkmsgpdeid, emtid, ltrcptsyno, ltrcpt, ltemis, flow,
    FINCopy, msgdateval, eventdate, typereseauid, infapseq1, infapseq2, direction, priority, ack, msgrefs, amlbehavior, ownerserviceid,
    correspondentName correspondentaddress, correspondentcity, correspondentcountry, correspondentnetworkaddr, tested,
    correspondentnetwork, validatedpercentage, nbofvalid, requestref, notifqueue, requesttype, secbpid, xqueue, receivercode,
    receiverind, validflag, ownerid, dn, rmaourbic, rmacorrespondentbic, rmaservice, filemsgref, acktext, format, xtype, wall,
    textetype, creatinguser, fileinfo, society, text, xlanguage, msgheaders, msgtrailer, jaxbref, jaxbelt)
    values
    (xmlid, x_extdate, x_eventType, x_amount, x_currency, x_state, x_units, x_correspondentId, x_sender, x_receiverNetworks, x_bankingPriority, x_applicationCode,
    x_processCounter, x_obsolescence, x_maxRetry, x_retries, x_fileSize, x_endFct, x_subType, x_field20, x_sequenceNumber, x_requestorDn, x_responderDn,
    x_SWIFTNetService, x_nonRepudiation, x_transfertRef, x_transfertInfo, x_fileDesc, x_transfertDesc, x_logicalName, x_signIndicator, x_critId, x_inFapId,
    x_deliveryNotif, x_comments, x_memos, x_msgSecuLevel, x_dates, x_tuxedoPriority, x_fileDest, x_stkMsgPDEId, x_EMTId, x_LTRcptSyno, x_LTRcpt, x_LTEmis, x_flow,
    x_FINCopy, x_msgDateVal, x_eventDate, x_typeReseauId, x_inFapSeq1, x_inFapSeq2, x_direction, x_priority, x_ack, x_msgrefs, x_amlbehavior, x_ownerServiceId,
    x_correspondentName, x_correspondentAddress, x_correspondentCity, x_correspondentCountry, x_correspondentnetworkaddr, x_tested,
    x_correspondentNetwork, x_validatedPercentage, x_nbOfValid, x_requestRef, x_notifQueue, x_requestType, x_secBpid, x_queue, x_receiverCode,
    x_receiverInd, x_validFlag, x_ownerId, x_dn, x_RMAOurBic, x_RMACorrespondentBic, x_RMAService, x_fileMsgRef, ackText, x_format, x_type, x_mur,
    x_TexteType, x_creatingUser, x_fileinfo, x_company d_text, x_language, d_msgHeaders, d_msgTrailer, x_jaxbRef, x_jaxbElt);

    Update temp_XML set status = 'Y' where XML_ID = xmlid;

    END;
    COMMIT;
    END LOOP;
    END;
    /

    1.No. multiple tag will vary how to extract those and concatenate them into a single column. I assumed that his occrrence in 3 for example:

    Use the fn:string-join() function:

    path varchar2 (4000) of comments 'string-join(comments/comment, "-").

    2. how to set the value NULL if no tag is not present. Tag in XML record number can vary.

    You don't have anything specific to do in this case.

    Missing tags with a projection in the COLUMNS clause will produce a column NULL by default.

Maybe you are looking for