what is the simpler way to generate a rowset...row xml structure with a normal, static query?

From: codadilupo <yossarian99_at_operamail.com>
Date: Fri, 15 Feb 2008 09:58:51 +0100
Message-ID: <47b5544b$0$21198$5fc30a8@news.tiscali.it>


Platform: Oracle 10.2.0.3 SE/Linux

I know that using DBMS_XMLGEN I can get query results in a ROWSET..ROW XML structure but I have to feed it with a dynamic SQL string or a ref cursor.

What is the simpler way to generate a ROWSET..ROW XML structure with a normal, static query?

My best shot is:

select
  xmlElement (
    "ROWSET",
    xmlAgg (

      xmlElement (
        "ROW",
        xmlForest (
          first_name,
          last_name,
          email
        )
      )

    )
  )
from
  employees
where
  manager_id=100
order by
  last_name
;

Is there a simpler way? I tried with SYS_XMLGEN but I'm not able to make it work with more than one column.

Thank you. Kind regards, C. Received on Fri Feb 15 2008 - 02:58:51 CST

Original text of this message