loops through the sections XML < RecieptDetails > and for each record found...

My input XML file is...
I get this XML using file adapter...

<? XML version = "1.0" encoding = "UTF-8"? >
-< root xmlns:ns2 = "http://www.w3.org/2001/XMLSchema" >
-< ns2:ReceiptBatch >
< ns2:FileID > "99999" < / ns2:FileID >
< ns2:Warehouse > in THE < / ns2:Warehouse >
'L' < ns2:Revision > < / ns2:Revision >
< ns2:DocID > A4 < / ns2:DocID >
-< ns2:Receipt >
< ns2:DeliveryNo > 123 - OP < / ns2:DeliveryNo >
< ns2:ProcessDate > 112138 < / ns2:ProcessDate >
< ns2:ContainerNo > 98765 < / ns2:ContainerNo >
< ns2:Instructions > TREKAU < / ns2:Instructions >
< ns2:ReceiptType > 1 < / ns2:ReceiptType >
< ns2:SuppCustCode > 111 < / ns2:SuppCustCode >
TREK-Cycle < ns2:SuppCustName > < / ns2:SuppCustName >
-< ns2:ReceiptDetails >
< ns2:Line > 1 < / ns2:Line >
< ns2:ProductCode > 1000 < / ns2:ProductCode >
< ns2:QuantityAdvised > 1 < / ns2:QuantityAdvised >
< ns2:QuantityReceived > 1 < / ns2:QuantityReceived >
< / ns2:ReceiptDetails >
-< ns2:ReceiptDetails >
< ns2:Line > 2 < / ns2:Line >
< ns2:ProductCode > 2000 < / ns2:ProductCode >
< ns2:QuantityAdvised > 2 < / ns2:QuantityAdvised >
< ns2:QuantityReceived > 2 < / ns2:QuantityReceived >
< / ns2:ReceiptDetails >
-< ns2:ReceiptDetails >
< ns2:Line > 3 < / ns2:Line >
< ns2:ProductCode > 2000 < / ns2:ProductCode >
< ns2:QuantityAdvised > 3 < / ns2:QuantityAdvised >
< ns2:QuantityReceived > 3 < / ns2:QuantityReceived >
< / ns2:ReceiptDetails >
< / ns2:Receipt >
< / ns2:ReceiptBatch >
< / root >

There are 2 tables in the database.
Table 1 = T1743512
Table 2 = T2743002

table - structure

T1743512-

DOCO KCOO DTCO LNID LNIX LITM NOTICE USR JOBN UPMJ PID'M CKNU UREC
123 00026 1 1 1000 1 1 123 - OP OP
124 00026 1 1 1000 1 1 124 - OP OP
123 00026 2 2 1000 2 2 123 - OP OP
123 00026 3 3 1000 3 2 123 - OP OP



Things to do are:--

1. Research Notice T1743512 (table) with the following keys:
1.T1743512. CKNU = < DeliveryNo > XML
2.T1743512. LNIX = XML < row >
II. write a record in the T2743002 table for each < RecieptDetails >. (See map below)

Mapping of the records in the table T2743002 to < ReceiptDetails >

EDU - "SABSSV".
EDBT - < EDBT > (the same for all records)
EDTN - < DeliveryNo > (from the section < reception > XML)
EDLN - < row > (from < ReceiptDetails > section in XML format)
EDSP - white
DOCO - white
DCTO - white
KCOO - white
LNID - white
LITM - < ProductCode > < ReceiptDetails > section
UORG - < QuantityAdvised > < ReceiptDetails > section
UREC - < QuantityReceived > < ReceiptDetails > section
USER - "SABSSV".
JOBN - "SOA - 3PL".
PID - 'PO-ENTRANTS ".
UPMJ - current Date Julian
- Hour current HHMMSS



Please suggest the solution.

Published by: Prashant_AP on June 22, 2012 12:24 AM

Hello

Solution by using a loop in BPEL;
1 count the number of nodes for ReceiptDetails.
2 create a counter for loop through each node ReceiptDetails. Use a while loop in BPEL
3 search T1743512 (table) with DeliveryNo and the line. Make sure that you select the correct line from the ReceiptDetails node element node. This can be done using the counter example of xpatch ns2:ReceiptBatch / ns2:Receipt / ns2:ReceiptDetails [counter] / ns2:Line. Please use the DB adapter.
I guess that the DeliveryNo can only appear once in the document following your example.
4. for each receiptDetails you write a record in table too T2743002. Please use the DB adapter.
5. Since the time increment the counter. This is to ensure that the while loop stops at the point where the counter is greater then the number of nodes to ReceiptDetails.

I think a better solution is to make the loop in PL/SQL. It will be faster. You specify an input of type of collection in your pl/sql package parameter. Assign all items receiptDetails and DeliverNo line to the PL/SQL package. Within PL/SQL unravel you the closure. With a little luck, you have the T2743002 in the same schema to create the record too. Otherwise create synonyms of the database or database links.

Good luck

Thank you

Sander

Tags: Fusion Middleware

Similar Questions

  • I want to loop through the data from two different tables using for loop where the query should be replaced at runtime, please help me

    I have the data into two table with the structure of similar column, I want to loop through the data in these two tables

    based on some condition and runtime that I want to put the query in loop for example, the example is given, please help me

    create table ab (a number, b varchar2 (20));

    Insert into ab

    Select rownum, rownum. "" sample "

    of the double

    connect by level < = 10

    create table bc (a number, b varchar2 (20));

    Insert into BC.

    Select rownum + 1, rownum + 1 | "" sample "

    of the double

    connect by level < = 10

    declare

    l_statement varchar2 (2000);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: =' select * ab ';

    on the other

    l_statement: =' select * from bc';

    end if

    I'm in execute immediate l_statement - something like that, but I don't know

    loop

    dbms_output.put_line (i.a);

    end loop;

    end;

    Something like that, but this isn't a peace of the code work.

    Try this and adapt according to your needs:

    declare

    l_statement varchar2 (2000);

    c SYS_REFCURSOR;

    l_a number;

    l_b varchar2 (20);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: = "select a, b, AB;

    on the other

    l_statement: = "select a, b from bc;

    end if;

    --

    Open c for l_statement;

    --

    loop

    extract the c in l_a, l_b;

    When the output c % notfound;

    dbms_output.put_line (l_a |') -' || l_b);

    end loop;

    close c;

    end;

    /

  • loop through the layers defining the lock and visibility

    I need to loop through the layers in the active document and the value of the properties of the layer is false or true.  I tried to create a loop using a method 'for', but it doesn't seem to work. I have renounced the method 'for' because I kept running into a problem.  I have set all layers with these settings just the odd ones (2,4,6, etc.). Here is sample if it was written.

    myLayer = myDoc.layers var [2];

    myLayer.visible = false;

    myLayer.locked = true;

    myLayer = myDoc.layers var [4];

    myLayer.visible = false;

    myLayer.locked = true;

    myLayer = myDoc.layers var [6];

    myLayer.visible = false;

    myLayer.locked = true;

    myLayer = myDoc.layers var [8];

    myLayer.visible = false;

    myLayer.locked = true;

    I have 208 layers, so doing it this way would be way to long. Any help would be appreciated.

    Illustrator CC 2014 running.

    After I wrote this and tested, I saw that Carlos had already answered, but I thought that I would post it anyway. Carlos KNOWS how much I love JS... ;-)

    One difference is that, since it was not clear to me which layer you talk like layer #1, I started at the bottom of the scale.  I hope this helps.  -TT

    var aDoc = app.activeDocument;
    var lc = aDoc.layers.length;
    for (var i = 2; i <= lc; i+=2) {
        var curLayer = lc - i
        aDoc.layers[curLayer].visible = false;
        aDoc.layers[curLayer].locked = true;
    }
    
  • SLQ: A loop with the select line, counters and variables

    Hello!

    I have a bit of a pickle SQL and would be very happy to any experienced help.
    I have a big enough table that contains two columns in particular (illustrated by a few examples)

    REFERENCE
    Mouth Med Chem (2008) 16, 1111-1124
    Bioorg Med Chem Lett. 2008 may 1; 9:2820 - 4 EPUB 2008 Apr 4
    BR J Pharmacol. In February 1999; 3:665 - 72.

    2_ YEAR
    1996
    2001

    Sometimes, the two columns are null. What I want to do, it is to loop through the table and pull on the date of the REFERENCE column and update the YEAR_2 column with it.

    My current code snippet is as follows:

    declare
    x number: = 1995;
    cursor s1 is SELECT rowid, t.* FROM CB1ASSAYS t WHERE REFERENCE like "%x % ';
    Start
    While x loop < 2006
    C1 loop s1
    Update CB1ASSAYS set YEAR_2 = x
    where REFERENCE like "%x % ';
    x: = x + 1;
    end loop;
    end loop;
    commit;
    end;
    /


    However, it doesn't seem to work properly. He updated lines with 1995 in the year, but no date higher. Curiously, he updated a number of records with the year 2064, when there was no 2064 anywhere in the REFERENCE entry.

    There are no errors encountered when I run this script.

    Any idea?

    Thank you!

    In your code the where conditions update should be:

    WHERE REFERENCE like '%'||x||'%';
    

    and you can get rid of the slider at all:

    declare
     x number := 1995;
    begin
     while x < 2006 loop
       update CB1ASSAYS set YEAR_2 = x
       where REFERENCE like '%x%'
       AND YEAR_2 is null --To update only null years
       ;
       x := x + 1;
     end loop;
    --commit;  IT's better you you commit after checked if all is ok...
    end;
    /
    

    Max

    Published by: Massimo Ruocchio July 5, 2011 19:59
    got rid of the cursor loop for...

  • Loop through the list in flex 4 conclusion d buttons

    Anyone know how to completely recursively loops through the list in flex 4 by pulling the bodies of buttons.  This way I can apply my effects for buttons on the screen at the same time?

    You just create a subclass of button that has the desired effect and use it throughout your application.

    Gordon Smith

    Adobe Flex SDK team

  • loop through the list in flex 4

    I want to loop through the list and apply the following code to each button, the checkbox and the descent down in my application

    mouseOver = "animateHover ('theComponentID').

    How is that possible?

    Hello

    This should do what you want, you must add the eventlistener now your animated can be run from the th event handler.

    protected function button1_clickHandler(event:MouseEvent):void

    {

    for (var i: Number = 0; i<>

    {

    var obj:Object = this.getElementAt (i);

    If (flash.utils.getQualifiedClassName (obj) is 'spark.components::Button')

    {

    (obj as Button) .addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);

    }

    If (flash.utils.getQualifiedClassName (obj) is 'spark.components::CheckBox')

    {

    (obj as CheckBox) .addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);

    }

    }

    }

    private void onMouseOver(event:MouseEvent):void

    {

    animateHover (event.currentTarget);

    }

  • To send messages through the network (LAN, netsend and msg.exe) does not win 7... can u tell me the cmd

    To send messages through the network (LAN, netsend and msg.exe) does not win 7... can u tell me the cmd

    If any document available please send my email id

    Thank you & best regards

    Martine

    Hello

    Thanks for posting your query to the Microsoft forum.

    Please see the suggestions in the following threads:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-networking/msgexe-netsend-anything-availible-on-Windows-7/e9743edc-AFA9-4942-b1c7-66baf443067b

    https://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-networking/net-send-in-command-prompt-does-not-work/00ce5137-dff7-49e5-8511-943e55b83bd7

    Let us know if you need more assistance. We will be happy to help you.

    ___________________

    Thank you best regards &,.

    Isha Soni

  • help to loop through the elements of page

    Hello

    I am new to InDesign scripting and I need a way to programmatically iterate through the items on a page in a document and get the entire block of text ID (Using javascript). Once I have a match of the text block I'm looking for, I'll have to update its content. Is there an easy way to do this?

    Thanks in advance!

    -Lloyd

    Hey!

    var myTextFrames = app.activeDocument.textFrames;
    var myTextFramesNo = myTextFrames.length;
    

    Now myTextFramesNo has number of blocks of text in the document and myTextFrames holds text objects frame. Now you can run through the blocks of text and content of the kit for each of them like this:

    myTextFrames[0].contents = "My Frame Contents";
    

    This is for beginning

    --

    tomaxxi

    http://indisnip.WordPress.com/

  • The sum of total revenue for each customer unique and graphic it!

    Sunny greetings from Athens!  I walked for 5 hours for an elegant solution to the following:

    I want to add the total amount of revenue for each customer unique and graphic to view what customers bring in most of the species.

    Example of this in it:

    Customers Charged €
    A 100
    B 200
    C 250
    A 130
    A 120
    B 100

    Customers

    Total €
    A 350
    B 300
    C 250

    How this can be implemented by the numbers? As elegantly as possible?

    Hi menick,.

    SUMIF () will do the job.

    the formula in table 2::B2 =.

    SUMIF (table 1::A, A2, table 1::B)

    It is filled down.

    Quinn

  • What is the difference in verses apps for each of the programs to purchase and download it?  They are the same thing and they are simply called "apps"?  Are the applications of complete programs?

    What is the difference in verses apps for each of the programs to purchase and download it?  They are the same thing and they are simply called "apps"?  Are the applications of complete programs?

    Yes.

    Adobe uses confusion of terminology in their efforts to explain things.

    Cloud desktop applications are the same as the purchase of the software on disk in the days avant-nuage. for example, the Photoshop Cloud desktop application is the full version of Photoshop CC 2015.

  • Hi, I have two decimal strings, each of them contains the numbers change over time. I want to plot them on the graph XY, a string for each axis. Can you show me how do?

    Hi, I have two decimal strings, each of them contains the numbers change over time. I want to plot them on the graph XY, a string for each axis. Can you show me how do?

    This is not a formula, but a constant simple schema of a table complex. Wire remains, then do a right click of the terminal of the initializer of the feedback node and select "create constant. That should do it.

  • generation of XML for each record

    I have a table db with a few thousand records in it. I need to generate an xml file for each record so that it can power a search machine.

    Can someone help me with this? I could not get it. Here is the example of table.

    create table test_xml)

    number of U_ID

    title varchar2 (500),

    VARCHAR2 (500) keywords.

    Description varchar2 (500),

    VARCHAR2 (500) of the user.

    e-mail varchar2 (500),

    initiator_function varchar2 (500),

    function_impacted varchar2 (500),

    old_request_num varchar2 (500),

    project_region varchar2 (500)

    );

    insert into test_xml values (1, "Heading1 test", "blah bla1", "test 123 ', 1234567',' [email protected]', 'test init funct', 'funct hit test', '55556677', 'abc' ');

    insert into test_xml values (2, 'Title2 test', 'blah bla2', ' test 1232', 1234522',' [email protected]', 'test init funct2 ',' test power supply impacted2', ' 55556679', 'abcccs' ");

    the end result is an XML for each record in this format.

    <? XML version = "1.0" encoding = "utf-8"? >

    <! DOCTYPE gsafeed PUBLIC "-//Google//DTD GSA RSS / / IN" "" > "".

    < gsafeed >

    < header >

    < datasource > ID 1 < / datasource >

    < feedtype > full < / feedtype >

    < / header >

    <>Group

    " < analysis record immediately = 'true' url = ' http://test.com/SearchResult.php?id=1 "action = 'Add' mimetype =" text/html"lock ="true"> "

    < content > <! [CDATA]

    < html >

    < head >

    Heading1 test < title > < /title >

    < meta name = "Keywords" content = "bla bla1" / >

    < name meta = "description" content = "testing 123" / >

    < name meta = "user" content = "1234567" / >

    " < name meta = 'EMAIL' content = ' [email protected] " />

    < name meta = "Source" content = "1" / >

    < / head >

    < body >

    < p > user: 1234567

    < p > EMAIL: bob . [email protected] 

    < p > INITIATOR_FUNCTION: test init funct

    < p > FUNCTION_IMPACTED: test hit funct

    < p > OLD_REQUEST_NUM: 555566777

    < p > PROJECT_REGION: abc

    < /p > < / body >

    < / html >

    []] > < / content / >

    < / recording >

    < / Group >

    < / gsafeed >

    Thanks for any help.

    I'd use SQL/XML functions, more rapid way to generate XML from relational data data.

    Something like the following should you get.

    It displays a document (such as a CLOB) per line in the base table:

    with html_content as (
      select xmlcdata(
               xmlserialize(document
                 xmlelement("html"
                 , xmlelement("head"
                   , xmlelement("title", t.title)
                   , xmlelement("meta", xmlattributes('Keywords' as "name", t.keywords as "content"))
                   , xmlelement("meta", xmlattributes('description' as "name", t.description as "content"))
                   , xmlelement("meta", xmlattributes('user' as "name", t.user_ as "content"))
                   , xmlelement("meta", xmlattributes('EMAIL' as "name", t.email as "content"))
                   , xmlelement("meta", xmlattributes('Source' as "name", t.u_id as "content")) -- ??
                   )
                 , xmlelement("body"
                   , xmlelement("p", 'EMAIL: '||t.email)
                   , xmlelement("p", 'INITIATOR_FUNCTION: '||t.initiator_function)
                   , xmlelement("p", 'FUNCTION_IMPACTED: '||t.function_impacted)
                   , xmlelement("p", 'OLD_REQUEST_NUM: '||t.old_request_num)
                   , xmlelement("p", 'PROJECT_REGION: '||t.project_region)
                   )
                 )
                 indent
               )
             ) as content
      from test_xml t
    )
    select '' ||
           '' ||
           xmlserialize(document
             xmlelement("gsafeed"
             , xmlelement("header"
               , xmlelement("datasource", 'ID 1')
               , xmlelement("feedtype", 'full')
               )
             , xmlelement("group"
               , xmlelement("record"
                 , xmlattributes(
                     'true' as "crawl-immediately"
                   , 'http://test.com/searchresult.php?ID=1' as "url"
                   , 'add' as "action"
                   , 'text/html' as "mimetype"
                   , 'true' as "lock"
                   )
                 , xmlelement("content", html.content)
                 )
               )
             )
             indent
           )
    from html_content html ;
    

    NB: indent option is to print only, you can remove it if you don't need.

  • [ADF, JDev 12.1.3] How to display multiple records on the same page... not in a table but they appear a form for each record

    Hallo,

    I need to create a page that displays the records of a VO, but I would not use a table.

    Instead, I would like to display a form for each record to be displayed.

    Forms must appear one above the other and each form should have 2 buttons: one to remove the file/form itself and one to add a new file/form.

    When you press the button Add a new empty form should be dynamically added to the page (so that the user can fill) and created related record.

    When REMOVE button is pressed the form (which contains the operated button) should be disappear and the record shuould be deleted.

    Creations and destruction must be applied only if the user clicks a button on CONFIRMATION / COMMIT.

    Maybe this http://digilander.libero.it/flattit82/OTN_FILES/MultiFormPage.png picture can help to understand what I want to do.

    You kindly help me?

    Thank you

    Federico

    Hi Federico

    I was saying that your page layout can be achieved using af: table

    See this image:

    This provision is af:table (I think same as yours), just add a column in the table and put all the fields in this column then correct layout allows to design as a provision on the form or group layouts

    I'm not saying it's the best approach, but you can try this

    Thank you

  • How can I create a slide show 100% width, but have the caption in different positions for each slide.

    How can I create a slide show 100% width, but have the caption in different positions for each slide.

    There is placement of the legend only one for all the images in a slide show.

    The slideshow widget is specialized to create slideshows of the image. The widget of composition is a much more flexible widget which allows any combination of images and text in the trigger containers or containers of target of the widget. A widget of composition could be used to create a slide show with several legends by image and/or legends of different places for each image. The disadvantage of the widget of composition is that, due to the nature flexible widget, very little is automated for you and so it is much more intensive work to create a slideshow of images using the widget of composition.

    Thank you

    Sanjit

  • For all the records for each record double, I need to get a single column with null or 0.

    Hi all

    I have a requirement where I need to get all the records, for each record in double, I need to get a single column with null or 0.

    create table a1

    (

    Identification number,

    VARCHAR2 (100), the point

    part varchar2 (100));

    Insert into a1

    values (1, 'ABC', 'A1');

    Insert into a1

    values (2, 'DEF', 'A2');

    TABLE A

    PART ITEM ID

    1 ABC A1

    1 ABC A1

    1 ABC A1

    DEF 2 A2

    DEF 2 A2

    3 DEF A2

    O/P

    PART ITEM ID

    1 ABC A1

    1        ABC             0

    1        ABC             0

    DEF 2 A2

    2       DEF              0

    3       DEF              0

    Thanks in advance.

    Thanks for your help FrankKalush...

    This one will work.

    WITH got_r_num AS

    (

    SELECT NVL (a1.id, a1.id) as id

    NVL (a1.item, a1.item) AS element

    NVL (a1.part, a1.part) IN the framework

    a1.id AS a_id

    ROW_NUMBER () OVER (PARTITION BY a1.id

    ORDER BY NULL

    ) AS r_num

    BY the a1

    )

    SELECT id

    element

    CASE

    WHEN a_id IS NOT NULL

    AND r_num = 1

    THEN part

    ELSE ' 0'

    END in the framework

    OF got_r_num

    ;

Maybe you are looking for

  • How can I add memory to my macbook

    MacBook is frozen I guess from the complete memory. How can I add a memory to my macbook?

  • Why am I unable to print from the web with Firefox (my favorite browser) and it market with IE?

    Hi, thanks for your time! I have problems printing from FireFox. I use PayPal for print shipping label (I sell on Ebay) and he's a few weeks that I have to use IE to print from the Internet. Nothing is printing from Firefox. And since it is my browse

  • Portege R500 shortcut keys work not

    Quick access keys (or function keys) no longer work on my Portege R500 even if the F10 and F11 keys work. I don't know exactly when they stopped working, or if it's related to a particular event. I use Windows XP. SP 3 I tried to downlowd various upd

  • Could not load file or Assembly runtime being more recent than currently loaded run time

    I've recently upgraded to TestStand 2010 and Visual Studio 2010 TestStand 4.2.1 and Visual Studio 2008. I now get the following error in the analysis of the sequence for all calls to my .net dll. "Step"My_StepType"not loadable module. Could not load

  • Newbie says Hello!

    Hi all Just got my Sansa Fuze and thinking, I want to just say how much I'm happy with it, and how I am happy to find such a decent forum. Never been a man of Apple, my last MP3 player has a Rio Karma, but the battery is endangered, unfortunately. Tw