Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

xmlattribute order

708631Apr 15 2013 — edited Apr 16 2013
hi, im sure someone will probably know this quickly.

Im generating some xml in oracle, one of the nested queries is similiar to this..
select  test1 
          ,test2
           ,  xmlelement
                ( "QUESTION"
                , xmlattributes ( question_n as "question_number",question as "question_t")  
              
             
                ) AS Xt1 
        FROM  myview_VW  
but for some reason in my end result the order of the questions are always messed up , is there a way to keep the attribute order ?


i have tried an order by here, but this query is nested in many others. like I said i basically want to just keep the order.
select  test1 
          ,test2
           ,  xmlelement
                ( "QUESTION"
                , xmlattributes ( question_n as "question_number",question as "question_t")  
              
             
                ) AS Xt1 order by question_n
        FROM  myview_VW  
I know i did not include any build code, if that is needed I will

thank you
This post has been answered by odie_63 on Apr 16 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2013
Added on Apr 15 2013
6 comments
245 views