Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

repeating nodes using FOR loop but when concating XML string then concating only last iteration of F

mradul goyalSep 11 2014 — edited Sep 16 2014
I stuck with a problem that I am using FOR loop for generating repeating nodes. 
Now when I concat the generated node in the main node then I got only last iteration of that FOR loop.
can anybody suggest me a way to handle this error....
FOR i IN 1..pl_phone_tab.Count
LOOP
SELECT xmlelement("Phone"     
                                    ,xmlelement("PHONETYPE",xmlattributes('01' AS "dmnADRP_PHONETYPE"),pl_phone_tab(i).p_phtype_tab)
                     ,xmlelement("PHONENUM",pl_phone_tab(i).p_phnum_tab)
                     ,xmlelement("PRIMARY_CONTACT",pl_phone_tab(i).p_prcon_tab)
                 )
INTO p_phone_xml
FROM dual; END LOOP;

SELECT xmlelement("PhoneInfo"
                       ,xmlconcat(p_phone_xml))
INTO p_phone_info_xml
FROM dual;
here I am getting only one node but there has to be two nodes for PHONE node
This post has been answered by odie_63 on Sep 12 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 14 2014
Added on Sep 11 2014
9 comments
3,292 views