var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Transform XML from a SELECT...FOR XML
I want to transform elements in a XML-respons.
If I use FOR XML PATH, ELEMENTS in the SELECT-statment I get the following result:
<namn>test bolag 2</namn>
I want to modify the elements so that they look like this insteed in the SELECT-statment.
<field name="namn">test bolag</field>
<field name="namn">test bolag 2</field>
I need to transform the resulting XML because I need to send it to a webservice with a mySQL database on the reciving end.
Please help me :-)
Could you please provide the query you are currently using?
SELECT foretag_nkl as nr, foretag as namn FROM dim_foretag
FOM XML PATH, ELEMENTS
The following article should be able to answer your question. Please let us know of how it went
Thanks for the article, it will be useful in some other questions I had :-)
But it didn't helped me to solve this particular problem. The elements are static for each item, that is <field name="nr"> has the same value for each row in the respons.
If I try to use ="nr" I get an error:
"Column name 'field = "nr"' contains an invalid XML identifier as required by FOR XML; ' '(0x0020) is the first character at fault."
Space, = or " are invalid in the XML output...
Hi, try with
FOR XML RAW