1 Reply Latest reply on Jan 11, 2012 9:27 AM by AlexAnd

    XML format

      Hello, I want to extract a table in xml format, with this specific format, I was not able, coulld you help me?

      For example, If we have:

      Id Card Name
      1 Renault Peter
      2 Citroen Charly
      3 Nissan Pierre
      4 Renault Lucas

      I want some thing like:

      <card TYPE="Renault">
      <Customer name="Peter"></Customer>
      <Customer name="Lucas"></Customer>
      <card TYPE="Citroen">
      <Customer name="Charly"></Customer>
      <card TYPE="Nissan">
      <Customer name="Pierre"></CUstomer>

      Thank you
        • 1. Re: XML format
          with t as
           (select 1 id, 'Renault' card, 'Peter' name
              from dual
            union all
            select 2, 'Citroen', 'Charly'
              from dual
            union all
            select 3, 'nissan', 'pierre'
              from dual
            union all
            select 4, 'Renault', 'Lucas' from dual)
          select xmlelement("export",
                                              xmlattributes(card as "type"),
                                                                xmlattributes(name as
            from t
           group by card
          Edited by: AlexAnd on Jan 11, 2012 1:26 AM