8 Replies Latest reply on Mar 10, 2012 5:55 PM by Mark Addleman

    New to SQL/XML:  Convert traditional result set into XML doc?

    Mark Addleman Master

      Suppose I have two tables:

       

      user:

      user_id
      Name
      maddlemanMark Addleman

       

      phonenumber:

      user_idphone_number

      maddleman123-123-1234
      maddleman456-456-4567

       

      I want to produce the following XML output:

      <user>Mark Addleman</user>

         <phone_number>123-123-1234</phone_number>

         <phone_number>456-456-4567</phone_number>

      </user>

       

      I can't figure out how to nest the SELECT of the phonenumber table in the outter SELECT in a way that makes Teiid happy.

      I'm brand new to SQL/XML so if there is some tutorial website you can point me to, I'd really appreciate it.