My handy scripts

I use this blog as a dumping ground for various scripts as well as solutions to Maths problems.

Labels

  • Alter (2)
  • Analytic functions (2)
  • AQ (2)
  • AWR (4)
  • Collections (2)
  • Connect By (2)
  • Constraints (7)
  • Date/Time calculations (3)
  • Dynamic SQL (4)
  • Explain Plan (1)
  • Formatting (3)
  • Functions (1)
  • Generating Functions (1)
  • Indexes (7)
  • Insert (3)
  • JMS (3)
  • Joins (4)
  • LOB (3)
  • locking (5)
  • Partitions (3)
  • Performance (10)
  • Security (1)
  • SQL Plus (3)
  • Tabibitosan (1)
  • Triggers (1)
  • Views (1)
  • XML (4)

Script categories

  • Performance (10)
  • Constraints (7)
  • Indexes (7)
  • locking (5)
  • AWR (4)
  • Dynamic SQL (4)
  • Joins (4)
  • XML (4)
  • Date/Time calculations (3)
  • Formatting (3)
  • Insert (3)
  • JMS (3)
  • LOB (3)
  • Partitions (3)
  • SQL Plus (3)
  • AQ (2)
  • Analytic functions (2)
  • Collections (2)
  • Connect By (2)
  • Explain Plan (1)
  • Functions (1)
  • Security (1)
  • Triggers (1)
  • Views (1)

Wednesday, 9 November 2011

Generate XML elements from a SQL result set

with t1 as
  (
    select '699' col1 from dual union
    select '996'      from dual
  )
--
select  
    xmlagg (
            xmlelement ("result", xmlforest (col1 "col1"))
           )
from   t1
Posted by bluefrog at 05:02
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: XML

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Archive

  • ►  2021 (1)
    • ►  03/14 - 03/21 (1)
  • ►  2013 (13)
    • ►  12/08 - 12/15 (1)
    • ►  12/01 - 12/08 (2)
    • ►  11/17 - 11/24 (1)
    • ►  10/20 - 10/27 (3)
    • ►  10/13 - 10/20 (1)
    • ►  08/04 - 08/11 (1)
    • ►  07/28 - 08/04 (1)
    • ►  07/21 - 07/28 (1)
    • ►  07/07 - 07/14 (1)
    • ►  02/17 - 02/24 (1)
  • ▼  2011 (47)
    • ►  11/20 - 11/27 (2)
    • ►  11/13 - 11/20 (4)
    • ▼  11/06 - 11/13 (6)
      • Identify SQL in blocking and waiting sessions
      • Identify blocking session for an UPDATE
      • Identify most scanned tables
      • Generate XML elements from a SQL result set
      • BULK collect XML into an OBJECT table
      • Extract data from single XML node
    • ►  10/30 - 11/06 (10)
    • ►  10/23 - 10/30 (1)
    • ►  10/16 - 10/23 (5)
    • ►  10/09 - 10/16 (2)
    • ►  09/25 - 10/02 (2)
    • ►  09/18 - 09/25 (14)
    • ►  08/28 - 09/04 (1)

About Me

bluefrog
View my complete profile

Followers

Powered by Blogger.