DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Merging XML Document

Threaded View

  1. #1
    Join Date
    Sep 2005
    Posts
    278

    Merging XML Document

    Hi everyone,

    I have a table with following structure

    SrcCode Char(5),
    DestCode Char(5),
    XMLDoc XMLType.

    I have a requirement to merge all the XML documents with same destCode under one parent tag.

    The contents of XMLDoc column is:

    HTML Code:
             <XMLDoc>
                    <Node1> </Node1>
                    <Node2> </Node2>
             </XMLDoc>
    I want the result in following format

    HTML Code:
    <Documents>
           <XMLDoc></XMLDoc>
           <XMLDoc></XMLDoc>
    </Documents>
    I try the following query but it does not provide me required results

    Select XMLElement("ParentNode", XMLDoc)
    from XMLDocs;

    but the query returns like
    HTML Code:
    <Documents> <XMLDoc></XMLDoc> </Documents>
    <Documents> <XMLDoc></XMLDoc> </Documents>
    Last edited by tabreaz; 07-22-2006 at 08:56 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width