6 Replies Latest reply on Jun 4, 2012 5:36 AM by Rajasekhar Kota

    Column value as identifier in XMLELEMENTmethod

    Rajasekhar Kota Newbie



      We are using Teiid 7.7. I have a concern on SQL / XML.


      I have a SQL as Select A.c1,A.c2,A.c3 from tab as A and the value of c2 will be the same for all the rows.


      I want to convert the values of the columns to XML. Also I want to retrieve the identifier value from the column's value


      Can I write the SQL as follows where the identifier name is the c1's column value.


      Select A.c2, xmlelement(A.c1, XMLATTRIBUTES(convert(A.C3, String) as "SYSID")) from tab as A


      We tried using this but there was a syntax error.


      Is there any way to achive this using any other method?