Jul-10-2020, 04:54 AM
HI All,
I have an input file sample like below
Thanks,
Aarush
I have an input file sample like below
<file="excel.1ew9u4t0tggb9315darmm0nfz2kb" name ="Custom SQL Query" type="text">SELECT [EMP$].[Category] AS [Category],&#13,&#10, [EMP$].[A] AS [A],&#13,&#10, [EMP$].[B] AS [B],&#13,&#10, [EMP$].[C] AS [C],&#13,&#10, [EMP$].[D AS [D,&#13,&#10, [Dept$].[E] AS [E],&#13,&#10, [Dept$].[F] AS [F (Dept)]&#13,&#10,FROM [EMP$]&#13,&#10, INNER JOIN [Dept$] ON [EMP$].[F] = [Dept$].[F] </file>I have to break the SQL and create an output xml like below
<records class="column"> <remote-name>A</remote-name> <remotetype>130</remotetype> <local-name>[A]</local-name> <parent-name>[Custom SQL Query]</parent-name> <remote-alias>A</remote-alias> <ordinal>1</ordinal> <local-type>string</local-type> <aggregation>Count</aggregation> <contains-null>true</contains-null> <collation-flag>1</collation-flag> <attributes> <attribute datatype="string" name="DebugRemoteType">WSTR</attribute> </attributes> </records> <records class="column"> <remote-name>B</remote-name> <remotetype>130</remotetype> <local-name>[B]</local-name> <parent-name>[Custom SQL Query]</parent-name> <remote-alias>B</remote-alias> <ordinal>2</ordinal> <local-type>string</local-type> <aggregation>Count</aggregation> <contains-null>true</contains-null> <collation-flag>1</collation-flag> <attributes> <attribute datatype="string" name="DebugRemoteType">WSTR</attribute> </attributes> </records> and so on for c , d etcCan someone help ? As im new to the xml and Im also trying but not able to get the desired answer.
Thanks,
Aarush