4 Replies Latest reply on Aug 24, 2010 10:37 AM by rareddy

    convert XML data into a Table

    rakeshsagar

      Hi Ramesh,

       

      I was going through the blog http://teiid.blogspot.com/ and it is very useful. In the blog you have mentioned that

      In the next blog, I will show you how to convert XML data into a Table, so stay tuned.

       

      Can you please tell me the steps to convert XML data into table as we have a similar requirement.

       

      Also, it would be good if it can be done through the Designer tool.

       

       

      Thanks

      Rakesh

        • 1. Re: convert XML data into a Table
          rareddy

          As I said it is coming in the next blog in next few days. If you are eager, read about XMLTABLE in Teiid Reference documentation on how model it right now. Teiid Designer support is coming in version 7.1 final.

           

          Ramesh..

          • 2. Re: convert XML data into a Table
            rakeshsagar

            Hi Ramesh,


            I had gone through the documentation of XMLTABLE function.


            For example If I have an xml file residing in C:\Rakesh directory say web.xml and
            I want to read the contents of the servlet-name tag in that XML.
            How do I specify the path of the XML file in the XMLTABLE function?
            Do I need to use the getTextFiles() function which we have used to read the text files?
            The web.xml file is attached.

            Also I have a question related to the following query

            select * from xmltable('/a' PASSING {x '<a id="1"/>'} COLUMNS id integer PATH '@id') x

            /a specifies the value to be fetched from the tag a right ?

            And the other attributes are optional right?


            Also, please let me know once you have written the bolg related to convertting XML data tinto the Table.


            Thanks

            Rakesh

            • 3. Re: convert XML data into a Table
              rakeshsagar

              Hi Ramesh,

               

              Can you please help me in solving this problem.

              • 4. Re: convert XML data into a Table
                rareddy

                Rakesh,

                 

                I am still putting some final touches before I sent out the email but here article I put together for converting the XML data into relational.

                 

                Your feed back is important, so let me know if you do not understand something.

                 

                Ramesh..